From cb39feaff074c5e08ff2dfce8dfa04c545233b7e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 17 Aug 2010 16:41:31 +0200 Subject: Don't try to update no package Check if there are packages to update for given architecure. Previously db-update quit when only one arch of a package was available. --- db-update | 10 ++++++---- test/runTest | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/db-update b/db-update index b11face..74abea8 100755 --- a/db-update +++ b/db-update @@ -60,10 +60,12 @@ for repo in ${repos[@]}; do ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" add_pkgs[${#add_pkgs[*]}]=${pkgfile} done - pushd "$FTP_BASE/$repo/os/${pkgarch}" >/dev/null - /usr/bin/repo-add -q "$repo$DBEXT" ${add_pkgs[@]} >/dev/null \ - || die "Could not add packages" - popd >/dev/null + if [ ${#add_pkgs[@]} -ge 1 ]; then + pushd "$FTP_BASE/$repo/os/${pkgarch}" >/dev/null + /usr/bin/repo-add -q "$repo$DBEXT" ${add_pkgs[@]} >/dev/null \ + || die "Could not add packages" + popd >/dev/null + fi done done diff --git a/test/runTest b/test/runTest index 95d8c6c..72f9b1c 100755 --- a/test/runTest +++ b/test/runTest @@ -42,6 +42,12 @@ testAddSimplePackages() { done } +testAddSingleSimplePackage() { + releasePackage extra 'pkg-simple-a' 'i686' + ../db-update + checkPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' +} + testAddAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase -- cgit v1.2.3-54-g00ecf