diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-01-31 21:46:13 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-27 15:46:04 +0200 |
commit | be30f5de81421f25609bf8021324fb14fec3437d (patch) | |
tree | 8d2693fb408becb2d092f82e2500309d45c1c5ff | |
parent | 68360bd443deaa0ae2d9dde7cfd905a3a46f76cc (diff) | |
download | dbscripts-be30f5de81421f25609bf8021324fb14fec3437d.tar.gz dbscripts-be30f5de81421f25609bf8021324fb14fec3437d.tar.xz |
fix db-update
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | db-functions | 2 | ||||
-rwxr-xr-x | 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 @@ -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[@]}" |