[pacman-dev] [PATCH] Ensure we are always in $SRCDEST before downloading

Allan McRae allan at archlinux.org
Wed Mar 27 08:34:14 EDT 2013


On 27/03/13 22:32, Dave Reisner wrote:
> On Wed, Mar 27, 2013 at 08:13:57PM +1000, Allan McRae wrote:
>> When VCS sources were updated, we changed into their root directory.
>> Any following source was then downloaded to an incorrect place causing
>> a failure in makepkg.  Ensure we are always in the $SRCDEST directory
>> before starting any download.
>>
>> Fixes FS#34488.
>>
>> Signed-off-by: Allan McRae <allan at archlinux.org>
>> ---
>>  scripts/makepkg.sh.in | 9 ++++-----
>>  1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index f9e0f95..45be8b6 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -749,12 +749,11 @@ download_sources() {
>>  		GET_VCS=0
>>  	fi
>>  
>> -	pushd "$SRCDEST" &>/dev/null
>> -
>>  	local netfile
>>  	for netfile in "${source[@]}"; do
>> -		local proto=$(get_protocol "$netfile")
>> +		pushd "$SRCDEST" &>/dev/null
> 
> I realize this patch doesn't change the situation at all, but do we know
> that $SRCDEST exists? can this pushd call fail?
> 

Yes:

SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined
if [[ ! -w $SRCDEST ]] ; then
...

>>  
>> +		local proto=$(get_protocol "$netfile")
>>  		case "$proto" in
>>  			local)
>>  				download_local "$netfile"
>> @@ -775,9 +774,9 @@ download_sources() {
>>  				download_file "$netfile"
>>  				;;
>>  		esac
>> -	done
>>  
>> -	popd &>/dev/null
>> +		popd &>/dev/null
>> +	done
>>  }
>>  
>>  # Automatically update pkgver variable if a pkgver() function is provided
>> -- 
>> 1.8.2
>>
>>
> 
> 
> 



More information about the pacman-dev mailing list