Skip to content
Snippets Groups Projects
Verified Commit 09897f0b authored by Morten Linderud's avatar Morten Linderud :surfer:
Browse files

ftpdir-cleanup.bats: Ensure we don't remove current debug package


The issue was that "repo-remove repo.tar.gz $pkgbase-debug" removes the
currently published debug package. We need to check if it's part of the
database or not before removing it.

Signed-off-by: default avatarMorten Linderud <morten@linderud.pw>
parent 6e477cd1
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,10 @@ for repo in "${PKGREPOS[@]}" "${DEBUGREPOS[@]}"; do
pkgbase="$(getpkgbase "${FTP_BASE}/${PKGPOOL}/${old_pkg}")"
pkgver="$(getpkgver "${FTP_BASE}/${PKGPOOL}/${old_pkg}")"
if debug_pkgfile=$(maybe_getpkgfile "${FTP_BASE}/${repo}-debug/os/${arch}/${pkgbase}-debug-${pkgver}-${arch}"${PKGEXTS}); then
msg2 'Found debug package, running repo-remove on %s...' "${debug_pkgfile##*/}"
arch_repo_modify remove "${repo}-debug" "${arch}" "${pkgbase}-debug"
if bsdtar -xOf "${FTP_BASE}/${repo}-debug/os/${arch}/${repo}-debug${DBEXT}" | awk '/^%FILENAME%/{getline;print}' | grep "${debug_pkgfile##*/}"; then
msg2 'Found debug package, running repo-remove on %s...' "${debug_pkgfile##*/}"
arch_repo_modify remove "${repo}-debug" "${arch}" "${pkgbase}-debug"
fi
fi
done
fi
......
......@@ -81,6 +81,29 @@ __checkRepoRemovedPackage() {
checkPackage extra-debug "${pkgs[1]}" 1-1
}
@test "cleanup debug packages with update" {
local arches=('x86_64')
local pkgs=('pkg-debuginfo-a' 'pkg-debuginfo-b')
local pkgbase
local arch
for pkgbase in ${pkgs[@]}; do
releasePackage extra ${pkgbase}
done
db-update
updatePackage pkg-debuginfo-a
releasePackage extra pkg-debuginfo-a
db-update
ftpdir-cleanup
checkPackage extra "${pkgs[0]}" 1-2
checkPackage extra "${pkgs[1]}" 1-1
checkPackage extra-debug "${pkgs[1]}" 1-1
checkPackage extra-debug "${pkgs[0]}" 1-2
}
@test "cleanup leaf debug" {
local arches=('x86_64')
local pkgs=('pkg-debuginfo-a' 'pkg-debuginfo-b')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment