tags:

views:

49

answers:

1

I am trying to patch dmenu with the files provided here: http://aur.archlinux.org/packages.php?ID=27334

I do not know how to do it, I've read that I should do patch file-to-patch the-patch, but in the patch provided there is more than one file involved. I've tried patching manually but I failed, it will not compile.

+1  A: 

Actually, it's patch < the_patch or cat the_patch | patch.

You may need to use the -p<n> option which is used to strip off segments of the pathnames stored in the patch. For example, if the patch was created from one level above the source tree (like you were diffing one tree against another) and you want to apply the patch from within the source tree, you would need -p.

Another useful option is --dry-run. That will act like it's applying the patch, but won't modify any files. It's a good thing to use to test if you have the -p option correct and to see if the patch will apply cleanly.

What I normally do is change to the root of the source tree and then run cat <file> | patch -p1 --dry-run. If I get errors about files not being found, I'll switch to -p0. Once either of those works, I remove the --dry-run and do it for real.

JayM
I just found it right now, the `-p<n>` parameter, thank you for the explanation though :]
Alberto Zaccagni