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-functions | 2 +- db-update | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/db-functions b/db-functions index 6efd85d..87488d2 100644 --- a/db-functions +++ b/db-functions @@ -521,7 +521,7 @@ arch_db_add() { local repo="$1" local tarch="$2" local pkgfiles=("${@:3}") - pkgfiles=("${pkgfiles##*/}") + pkgfiles=("${pkgfiles[@]##*/}") local dstdir="$FTP_BASE/$repo/os/$tarch" for pkgfile in "${pkgfiles[@]}"; do 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