[pacman-dev] [PATCH] makepkg: avoid duplication in source fetching
Unique the return lists of sources to prevent duplication which occurs because of merge_arch_attrs. Fixes: https://bugs.archlinux.org/task/43387 --- scripts/makepkg.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 1720e64..85e297a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -792,6 +792,9 @@ get_all_sources() { fi done + # TODO(dreisner): get rid of this once merge_arch_attrs is dead + mapfile -t aggregate < <(printf '%s\n' "${aggregate[@]}" | awk '!a[$0]++') + array_build "$1" "aggregate" } @@ -806,6 +809,9 @@ get_all_sources_for_arch() { aggregate+=("${l[@]}") fi + # TODO(dreisner): get rid of this once merge_arch_attrs is dead + mapfile -t aggregate < <(printf '%s\n' "${aggregate[@]}" | awk '!a[$0]++') + array_build "$1" "aggregate" } @@ -1607,6 +1613,8 @@ source_safe() { shopt -s extglob } +# TODO(dreisner): kill off this function and consistently access arch-specific +# attributes throughout. merge_arch_attrs() { local attr supported_attrs=( provides conflicts depends replaces optdepends -- 2.2.1
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.
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. Allan
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.
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
participants (2)
-
Allan McRae
-
Dave Reisner