Re: patching from different directory

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



Hi,

On Thu, Sep 10, 2009 at 14:04, Carlos Santana <neubyr@xxxxxxxxx> wrote:
> I have a diff file in my /var/tmp and would like to apply patch to a
> file in a different directory (other than /va/tmp). I tried using
> patch with -d switch, but that doesn't work. It complains abt  'patch:
> **** Can't open patch file tilda.diff : No such file or directory'. Do
> I need to copy my diff file to the directory where original file
> resides? Or is there any other way round?

Try:

cd /path/to/file/to/be/patched
patch -p0 </var/tmp/tilda.diff

You might want to use -p1 or -p2 or -p3... depending on what is the
path to the file inside the .diff file. To figure that out, open the
.diff file and look at the lines that start with --- and +++, then see
how many directories are there before the filename, use that number
for the argument to -p.

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux