[pacman-dev] [PATCH] makepkg: avoid duplication in source fetching

Allan McRae allan at archlinux.org
Mon Jan 12 01:15:59 UTC 2015


On 12/01/15 11:08, Allan McRae wrote:
> On 12/01/15 01:17, Dave Reisner wrote:
>> Unique the return lists of sources to prevent duplication which occurs
>> because of merge_arch_attrs.
>>
>> Fixes: https://bugs.archlinux.org/task/43387
> 
> 
> Lets fix the actual issue...
> 
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 1720e64..69e2df1 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -786,6 +786,8 @@ get_all_sources() {
>                 aggregate+=("${l[@]}")
>         fi
> 
> +       unset l
> +
>         for a in "${arch[@]}"; do
>                 if array_build l "source_$a"; then
>                         aggregate+=("${l[@]}")
> @@ -802,6 +804,8 @@ get_all_sources_for_arch() {
>                 aggregate+=("${l[@]}")
>         fi
> 
> +       unset l
> +
>         if array_build l "source_$CARCH"; then
>                 aggregate+=("${l[@]}")
>         fi
> 
> 
> 
> And even then this does not fix the real issue...   array_build() should
> clear $1 as it appends onto it.   I'm not sure how to do that.
> 


As an aside, is there any reason to be using array_build() when dealing
with sources or checksums?   These are only global attributes and can be
accessed directly.

Allan


More information about the pacman-dev mailing list