From: Pierre Schmitz <pie...@archlinux.de>

(cherry picked from commit 10439da698c8eb723b1637b803cb37370245a2f8)
---
 db-repo-add                 |  4 ++--
 test/cases/db-repo-add.bats | 22 ++++++++++++++++++++++
 test/lib/common.bash        |  1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/db-repo-add b/db-repo-add
index c9e3a15..0fc69fe 100755
--- a/db-repo-add
+++ b/db-repo-add
@@ -30,8 +30,8 @@ done
 
 for tarch in "${tarches[@]}"; do
        for pkgfile in "${pkgfiles[@]}"; do
-               if [[ ! -f "${FTP_BASE}/${repo}/os/${arch}/${pkgfile##*/}" ]]; 
then
-                       die "Package file %s not found in %s" "${pkgfile##*/}" 
"${FTP_BASE}/${repo}/os/${arch}/"
+               if [[ ! -f ${FTP_BASE}/${repo}/os/${tarch}/${pkgfile##*/} ]]; 
then
+                       die "Package file %s not found in %s" "${pkgfile##*/}" 
"${FTP_BASE}/${repo}/os/${tarch}/"
                else
                        msg "Adding %s to [%s]..." "$pkgfile" "$repo"
                fi
diff --git a/test/cases/db-repo-add.bats b/test/cases/db-repo-add.bats
index aeab8ef..d76b245 100755
--- a/test/cases/db-repo-add.bats
+++ b/test/cases/db-repo-add.bats
@@ -45,3 +45,25 @@ load ../lib/common
                done
        done
 }
+
+@test "add any packages" {
+       local pkgs=('pkg-any-a' 'pkg-any-b')
+       local pkgbase
+       local arch
+
+       for pkgbase in ${pkgs[@]}; do
+               releasePackage extra ${pkgbase} any
+               mv "${STAGING}"/extra/* "${FTP_BASE}/${PKGPOOL}/"
+               for arch in "${ARCH_BUILD[@]}"; do
+                       ln -s 
"${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-any.pkg.tar.xz" 
"${FTP_BASE}/extra/os/${arch}/"
+                       ln -s 
"${FTP_BASE}/${PKGPOOL}/${pkgbase}-1-1-any.pkg.tar.xz.sig" 
"${FTP_BASE}/extra/os/${arch}/"
+               done
+               db-repo-add extra any ${pkgbase}-1-1-any.pkg.tar.xz
+       done
+
+       for pkgbase in ${pkgs[@]}; do
+               for arch in "${ARCH_BUILD[@]}"; do
+                       checkPackageDB extra ${pkgbase}-1-1-any.pkg.tar.xz 
${arch}
+               done
+       done
+}
diff --git a/test/lib/common.bash b/test/lib/common.bash
index 6b3b2ad..fd1c8bb 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -65,6 +65,7 @@ setup() {
        SRCPOOL='sources/packages'
        TESTING_REPO='testing'
        STABLE_REPOS=('core' 'extra')
+       ARCHES=(${ARCH_BUILD[*]@Q})
        CLEANUP_DESTDIR="${TMP}/package-cleanup"
        SOURCE_CLEANUP_DESTDIR="${TMP}/source-cleanup"
        STAGING="${TMP}/staging"
-- 
2.16.2

_______________________________________________
Dev mailing list
Dev@lists.parabola.nu
https://lists.parabola.nu/mailman/listinfo/dev

Reply via email to