[pacman-dev] [PATCH] makepkg: fix --allsource when remote source files do not reside in SRCDEST

Cedric Staniewski cedric at gmx.ca
Sat Oct 17 15:19:52 EDT 2009


Xavier wrote:
> On Sat, Oct 17, 2009 at 7:42 PM, Cedric Staniewski <cedric at gmx.ca> wrote:
>> When using the --allsource option, it was assumed that remote source
>> files reside in SRCDEST which is not necessarily always the case.
>>
> 
> I am not familiar with the code, but why aren't all source files in srcdest ?
> I thought and assumed they were.

If SRCDEST is defined in makepkg.conf, there are actually two possible locations where (remote) source files can be saved to. They can either reside in the configured SRCDEST (which is where makepkg puts downloaded sources) or in the same directory as the PKGBUILD, and moreover, the file in the PKGBUILD directory is favored over the one in SRCDEST.

Several functions (check_checksums, extract_sources and probably more) use something like the following to get the correct file name:

> 				if [ ! -f "$file" ] ; then
> 					if [ ! -f "$SRCDEST/$file" ] ; then
> 						echo "$(gettext "NOT FOUND")" >&2
> 						errors=1
> 						found=0
> 					else
> 						file="$SRCDEST/$file"
> 					fi
> 				fi

This bug can be easily confirmed by running makepkg --allsource in a PKGBUILD directory (obviously the PKGBUILD should use remote sources), extract the generated source package, remove the sources of this package from SRCDEST if defined in makepkg.conf, change into the extracted directory and run makepkg --allsource (-f) again.



More information about the pacman-dev mailing list