From be30f5de81421f25609bf8021324fb14fec3437d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 31 Jan 2014 21:46:13 +0100 Subject: fix db-update Signed-off-by: Florian Pritz --- db-update | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 230879f..e924f45 100755 --- a/db-update +++ b/db-update @@ -58,18 +58,24 @@ for repo in ${repos[@]}; do done for repo in ${repos[@]}; do - declare -a pkgs_to_add=() + declare -a pkgfiles=() + for pkgfile in $(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT} 2>/dev/null); do arch_add_to_pool "$pkgfile" - for pkgarch in ${ARCHES[@]}; do - pkgfile_arch="$STAGING/$repo/$pkgarch/${pkgfile##*/}" + pkgfiles=("${pkgfiles[@]}" "${pkgfile##*/}") + done + + for pkgarch in ${ARCHES[@]}; do + declare -a pkgs_to_add=() + for pkgfile in "${pkgfiles[@]}"; do + pkgfile_arch="$STAGING/$repo/$pkgarch/$pkgfile" if [[ -h "$pkgfile_arch" ]]; then - pkgs_to_add=("${pkgs_to_add[@]}" "${pkgfile##*/}") + pkgs_to_add=("${pkgs_to_add[@]}" "$pkgfile") rm "$pkgfile_arch" fi done + arch_db_add $repo "$pkgarch" "${pkgs_to_add[@]}" done - arch_db_add $repo "$pkgarch" "${pkgs_to_add[@]}" done arch_history_commit "db-update: ${repos[@]}" -- cgit v1.2.3-24-g4f1b