diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-03-23 19:50:56 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-03-23 19:50:56 +0100 |
commit | d568b8aeb0be95d6a1da7da0434de23e6b2260e2 (patch) | |
tree | 3051c14427751e9e79b1f4878fb6e8299440d728 /test | |
parent | 9e4f661adf89d150b0891d6edd39e19682d923bf (diff) |
Add support for packages which use the epoch variable
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/common.inc | 4 | ||||
l--------- | test/packages/pkg-simple-epoch/Makefile | 1 | ||||
-rw-r--r-- | test/packages/pkg-simple-epoch/PKGBUILD | 23 | ||||
l--------- | test/packages/pkg-simple-epoch/test.c | 1 | ||||
-rwxr-xr-x | test/test.d/create-filelists.sh | 2 | ||||
-rwxr-xr-x | test/test.d/db-move.sh | 22 | ||||
-rwxr-xr-x | test/test.d/db-remove.sh | 2 | ||||
-rwxr-xr-x | test/test.d/db-update.sh | 6 | ||||
-rwxr-xr-x | test/test.d/ftpdir-cleanup.sh | 28 | ||||
-rwxr-xr-x | test/test.d/sourceballs.sh | 2 |
10 files changed, 86 insertions, 5 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc index 208400c..46747ff 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -18,7 +18,7 @@ oneTimeSetUp() { pushd $d >/dev/null pkgname=($(. PKGBUILD; echo ${pkgname[@]})) pkgarch=($(. PKGBUILD; echo ${arch[@]})) - pkgversion=$(. PKGBUILD; echo ${pkgver}-${pkgrel}) + pkgversion=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) build=true for a in ${pkgarch[@]}; do @@ -112,7 +112,7 @@ releasePackage() { pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null archrelease ${repo}-${arch} >/dev/null 2&>1 - pkgver=$(. PKGBUILD; echo "${pkgver}-${pkgrel}") + pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) popd >/dev/null cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}.pkg.tar.* "${STAGING}"/${repo}/ } diff --git a/test/packages/pkg-simple-epoch/Makefile b/test/packages/pkg-simple-epoch/Makefile new file mode 120000 index 0000000..50be211 --- /dev/null +++ b/test/packages/pkg-simple-epoch/Makefile @@ -0,0 +1 @@ +../../src/Makefile
\ No newline at end of file diff --git a/test/packages/pkg-simple-epoch/PKGBUILD b/test/packages/pkg-simple-epoch/PKGBUILD new file mode 100644 index 0000000..eebe2bd --- /dev/null +++ b/test/packages/pkg-simple-epoch/PKGBUILD @@ -0,0 +1,23 @@ +pkgname=pkg-simple-epoch +pkgver=1 +pkgrel=1 +epoch=1 +pkgdesc="A package called ${pkgname}" +arch=('i686' 'x86_64') +url='http://www.archlinux.org/' +license=('GPL') +depends=('glibc') +makedepends=('gcc') +source=('Makefile' 'test.c') +md5sums=('c6cb8dcc86253355fed559416d0c8dcf' + '3c1e4279feb678fd9cabaccdb28e40d0') + +build() { + cd ${srcdir} + make +} + +package() { + cd ${srcdir} + make install DESTDIR=${pkgdir} DESTBIN=${pkgname} +} diff --git a/test/packages/pkg-simple-epoch/test.c b/test/packages/pkg-simple-epoch/test.c new file mode 120000 index 0000000..ed5b5ac --- /dev/null +++ b/test/packages/pkg-simple-epoch/test.c @@ -0,0 +1 @@ +../../src/test.c
\ No newline at end of file diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index da76710..08b6790 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testCreateSimpleFileLists() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/db-move.sh b/test/test.d/db-move.sh index 57cbf71..6da25c4 100755 --- a/test/test.d/db-move.sh +++ b/test/test.d/db-move.sh @@ -27,6 +27,28 @@ testMoveSimplePackages() { done } +testMoveEpochPackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-simple-epoch') + local pkgbase + local arch + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage testing ${pkgbase} ${arch} + done + done + + ../db-update + + ../db-move testing extra pkg-simple-epoch + + for arch in ${arches[@]}; do + checkPackage extra pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch} + checkRemovedPackage testing pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz ${arch} + done +} + testMoveAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase diff --git a/test/test.d/db-remove.sh b/test/test.d/db-remove.sh index b66466d..573bd71 100755 --- a/test/test.d/db-remove.sh +++ b/test/test.d/db-remove.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testRemovePackages() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-split-a' 'pkg-split-b' 'pkg-simple-epoch') local pkgbase local arch diff --git a/test/test.d/db-update.sh b/test/test.d/db-update.sh index 5a3d01d..8acfbeb 100755 --- a/test/test.d/db-update.sh +++ b/test/test.d/db-update.sh @@ -30,6 +30,12 @@ testAddSingleSimplePackage() { checkPackage extra 'pkg-simple-a-1-1-i686.pkg.tar.xz' 'i686' } +testAddSingleEpochPackage() { + releasePackage extra 'pkg-simple-epoch' 'i686' + ../db-update + checkPackage extra 'pkg-simple-epoch-1:1-1-i686.pkg.tar.xz' 'i686' +} + testAddAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index e9b977b..17287f5 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -34,6 +34,34 @@ testCleanupSimplePackages() { done } +testCleanupEpochPackages() { + local arches=('i686' 'x86_64') + local pkgs=('pkg-simple-epoch') + local pkgbase + local arch + + for pkgbase in ${pkgs[@]}; do + for arch in ${arches[@]}; do + releasePackage extra ${pkgbase} ${arch} + done + done + + ../db-update + + for arch in ${arches[@]}; do + ../db-remove pkg-simple-epoch extra ${arch} + done + + ../cron-jobs/ftpdir-cleanup >/dev/null + + for arch in ${arches[@]}; do + local pkg1="pkg-simple-epoch-1:1-1-${arch}.pkg.tar.xz" + checkRemovedPackage extra 'pkg-simple-epoch' ${arch} + [ -f "${FTP_BASE}/${PKGPOOL}/${pkg1}" ] && fail "${PKGPOOL}/${pkg1} found" + [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkg1}" ] && fail "${repo}/os/${arch}/${pkg1} found" + done +} + testCleanupAnyPackages() { local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase diff --git a/test/test.d/sourceballs.sh b/test/test.d/sourceballs.sh index 8cba017..11bd0f4 100755 --- a/test/test.d/sourceballs.sh +++ b/test/test.d/sourceballs.sh @@ -5,7 +5,7 @@ curdir=$(readlink -e $(dirname $0)) testSourceballs() { local arches=('i686' 'x86_64') - local pkgs=('pkg-simple-a' 'pkg-simple-b') + local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase local arch |