patchfiles and specifying -p

Blair Zajac blair at orcaware.com
Sat May 15 16:59:32 PDT 2010


On May 15, 2010, at 2:38 PM, Rainer Müller wrote:

> On 2010-05-15 20:03 , Blair Zajac wrote:
>> How about extending patchfiles to specify the number of directory path elements 
>> to strip from the patch, like patch's -p?
>> 
>> This would allow us to use upstream patches without modification if they are 
>> generated with git, which prepends "a/" and "b/" to the paths.
> 
> We already have patch.pre_args which is -p0 by default. But this will be
> applied to all patchfiles.

OK.

> 
>> The format could be
>> 
>> patchfiles foo.diff:2
>> 
>> which would be equivalent to "patch -p2 < foo.diff".
> 
> The colon is already being used to specify subdirectories and tags for
> fetching in the same way as it is being used in distfiles:
> 
> patchfiles foo.diff:tag
> patchfiles foo.diff:subdir:tag

Maybe then # to indicate the number of directories to trim?

Blair



More information about the macports-dev mailing list