summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-03-15 08:49:40 +0100
committerAllan McRae <allan@archlinux.org>2015-03-26 05:43:37 +0100
commit30c9dbcdeb82ddecf20bddd24faed64a73ff502a (patch)
tree6cb4807b96ae4f263ab92a8a849254d36dc20823
parent6aef45ee1aaf27dba21265fbdd65139061a91123 (diff)
downloadpacman-30c9dbcdeb82ddecf20bddd24faed64a73ff502a.tar.gz
pacman-30c9dbcdeb82ddecf20bddd24faed64a73ff502a.tar.xz
repo-add: remove duplication finding old package details
The information needed to create a delta entry and remove the old package from the filesystem are the same. Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/repo-add.sh.in10
1 files changed, 1 insertions, 9 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index c16295be..75121361 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -334,15 +334,7 @@ db_write_entry() {
return 0;
fi
else
- if (( DELTA )); then
- pkgentry=$(find_pkgentry "$pkgname")
- if [[ -n $pkgentry ]]; then
- local oldfilename=$(grep -A1 FILENAME "$pkgentry/desc" | tail -n1)
- local oldfile="$(dirname "$1")/$oldfilename"
- fi
- fi
- if (( RMEXISTING )); then
- # gather information needed to remove old file
+ if (( DELTA || RMEXISTING )); then
pkgentry=$(find_pkgentry "$pkgname")
if [[ -n $pkgentry ]]; then
local oldfilename="$(sed -n '/^%FILENAME%$/ {n;p;q;}' "$pkgentry/desc")"