diff options
author | Erich Eckner <git@eckner.net> | 2016-04-27 09:43:42 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-04-27 10:17:48 +0200 |
commit | a7b99ed1bc9a95be7529f4cef160560653f548c2 (patch) | |
tree | 3c0e859092ef7677eeb81cf20412937a83fb24bc | |
parent | 4b5685e2be40daff14c3afd988366ddc134d9862 (diff) | |
download | archlinuxewe.git.save-a7b99ed1bc9a95be7529f4cef160560653f548c2.tar.xz |
archPackagesUpdate entfernt jetzt alte Pakete korrekt(er)
-rwxr-xr-x | archPackagesUpdate | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate index 71cb78cd..1ada763e 100755 --- a/archPackagesUpdate +++ b/archPackagesUpdate @@ -448,32 +448,33 @@ then tar -cf - ${paket}-${vers}-${arch}.pkg.tar.xz{,.sig} | ssh paule@127.0.0.1 ' - rmPaket() { - [ "$(basename "$(pwd)")" == "any" ] || \ - repo-remove '${checkDbSig}' -s -k 0x20194BA1 archlinuxewe.db.tar.gz "${1%-*-*-*.pkg.tar.xz}" - rm "$1" - [ -e "$1.sig" ] && rm "$1.sig" + entferneAltePakete() { + altePakete=$( + ls -1 | \ + grep "^$1-[^-]\+-[^-]\+-$2\.pkg\.tar\.xz\$" + ) + if [ -n "${altePakete}" ] + then + [ "$(basename "$(pwd)")" == "any" ] || \ + repo-remove '${checkDbSig}' -s -k 0x20194BA1 archlinuxewe.db.tar.gz "$1" + for altesPaket in ${altePakete} + do + rm "${altesPaket}" + if [ -e "${altesPaket}.sig" ] || [ -h "${altesPaket}.sig" ] + then + rm "${altesPaket}.sig" + fi + done + fi } addPaket() { - neu="$1" - for alt in $( - ls -1 | \ - grep "^${neu%-*-*-*.pkg.tar.xz}-[^-]\+-[^-]\+-'${arch}'\.pkg\.tar\.xz\$" - ) - do - [ "${alt}" == "${neu}" ] && continue - rmPaket "${alt}" - done [ "$(basename "$(pwd)")" == "any" ] || \ - repo-add '${checkDbSig}' -s -k 0x20194BA1 archlinuxewe.db.tar.gz "${neu}" + repo-add '${checkDbSig}' -s -k 0x20194BA1 archlinuxewe.db.tar.gz "$1" } cd '${pkgDir}/${arch}/' - if [ -e "'${paket}-${vers}-${arch}.pkg.tar.xz'" ] - then - rmPaket "'${paket}-${vers}-${arch}.pkg.tar.xz'" - fi + entferneAltePakete "'${paket}'" "'${arch}'" tar -xf - addPaket "'${paket}-${vers}-${arch}.pkg.tar.xz'" @@ -486,10 +487,7 @@ then [ "${lArch}" == "any" ] && continue cd "${lArch}" - if [ -e "'${paket}-${vers}-${arch}.pkg.tar.xz'" ] - then - rmPaket "'${paket}-${vers}-${arch}.pkg.tar.xz'" - fi + entferneAltePakete "'${paket}'" "'${arch}'" ln -s "'${pkgDir}/any/${paket}-${vers}-${arch}.pkg.tar.xz'" "'${paket}-${vers}-${arch}.pkg.tar.xz'" if [ -e "'${pkgDir}/any/${paket}-${vers}-${arch}.pkg.tar.xz.sig'" ] then |