[git-buildpackage] PATCH: buildpackage-rpm: packaging: no symlink to other dirs [was: Re: [PATCH] Add --git-packaging-exclude to gbp buildpackage-rpm]
Markus Lehtonen
markus.lehtonen at linux.intel.com
Fri Mar 18 07:52:57 CET 2016
Hi,
On 15/03/16 14:42, "git-buildpackage on behalf of Tzafrir Cohen" <git-buildpackage-bounces at lists.sigxcpu.org on behalf of tzafrir at cohens.org.il> wrote:
>On Wed, Feb 17, 2016 at 10:34:19AM +0100, Tzafrir Cohen wrote:
>
>> The patch is indeed too agressive, but the problem is that copying all
>> the top-level files in the tree may fail if one of them is a symlink to
>> somewhere below in the tree.
>>
>> Note that symlink is readable. It's not a dandling symlink. However the
>> copying of the packaging files only copies the top-level files.
>
>Sorry for the delay. Attached a more direct fix for the issue: when
>copying packaging files, skip symlinks to any files that are not in hte
>same directory.
Using os.path.isabs() instead of find() would me clearer, IMO. I.e.
+ elif os.path.islink(src) and not os.path.isabs(os.readlink(src)):
And, I would still emphasise (and recommend) the usage of the --git-packaging-dir option. If you move packaging files into a separate packaging dir (e.g. rpm/) you won't have this problem. I would even mention this in the commit message, i.e. something like:
"If --git-packaging-dir is not defined buildpackage-rpm considers all files..."
Thanks,
Markus
More information about the git-buildpackage
mailing list