diff and patch Was: Re: need help with yasr patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cheryl Homiak <chomiak@xxxxxxxxxxxxx> writes:

> Just be sure you cut it off at the right place when you edited it out of the
> email.

Tip of the day: patch is smart enough to detect if
you got extra, irrelevant, lines of text in your patch file.
So usually, you should be able to just save the mail, and apply
it, as long as the patch wasn't base64 encoded or something like that.

Looking at "cvs diff" output is an example for that.  cvs outputs
additional lines of information about the patch, which are not
part of a normal diff file.  patch happily ignores those without the need
to manually edit the diff, or  filter it in some way.

Another related trick is executable patch files.  Since
patch ignores irrelevant, non-diff text lines, you can begin
your patch file like
#!/bin/sh

and write a little interactive script which applies "patch" on itself,
something like

patch -p1 <$0

This way you can put safety checks in your patch to avoid
common user errors.  You just need to set the executable bit
on your patch file, and off you go.

-- 
CYa,
  Mario | Debian Developer <URL:http://debian.org/>
        | Get my public key via finger mlang@xxxxxxxxxxxxx
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44


_______________________________________________

Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list

[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]