[pacman-dev] [PATCH] makepkg: add --allsource option

Allan McRae mcrae_allan at hotmail.com
Mon Jun 2 11:56:49 EDT 2008


Dan McGee wrote:
> On Mon, Jun 2, 2008 at 9:56 AM, Allan McRae <mcrae_allan at hotmail.com> wrote:
>   
>> Dan McGee wrote:
>>     
>>> <snip>
>>> +     local netfile
>>> +     for netfile in ${source[@]}; do
>>> +             local file=$(strip_url "$netfile")
>>> +             if [ -f $netfile ]; then
>>> +                     msg2 "$(gettext "Adding %s...")" "$netfile"
>>> +                     comp_files="$comp_files $netfile"
>>> +             elif [ "$SOURCEONLY" = "2" -a -f "$srcdir/$file" ]; then
>>> +                     msg2 "$(gettext "Adding %s...")" "$file"
>>> +                     comp_files="$comp_files -C $srcdir $file"
>>>
>>>       
>> I'm a little confused here.  The file $srcdir/$file is just a link to
>> $SRCDEST/$file which may be $startdir/$file.  So does this not just add
>> the symbolic link to the tarball.  Also, the -C option flags all
>> following files to be from the $srcdir directory.  So, anything added
>> after this will also get its symbolic link added.
>>
>> If I'm not going down the wrong track here, this should fix it...
>>     
>
> Yeah, this wasn't tested super hard or anything so I think you are on
> to something here. The -C option is definitely a bit odd but it kind
> of does what we want. Since all files are available in src/ (although
> some might be symlinks), can't we use 1 -C flag in combination with -H
> to follow symlinks to our source files?
>   

The files are not in src/ if the --source was used so we have to be 
careful there. 

> While we are making changes, can you see an easy way to get everything
> under a pkgname/ dir (maybe with pkgver-pkgrel too) inside the
> tarball? Unfortunately bsdtar has no --prefix option to easily do
> this, and our friend Loui says it is doable but has not offered a line
> of code.
>
>   

How about:
- Make directory of form pkgname-pkgver-pkgrel in a temporary directory
- Instead of collecting files in "comp_files", just place links into 
that directory.
- Use bsdtar with -L flag on that directory.
- Clean up

I think that is along the lines of what Loui was suggesting. It also 
removes the whole -C issue without adding any further SOURCEONLY=2 checks.

Allan






More information about the pacman-dev mailing list