mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 17:31:52 -05:00
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>
This commit is contained in:
parent
6aef45ee1a
commit
30c9dbcdeb
@ -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")"
|
||||
|
Loading…
x
Reference in New Issue
Block a user