repo-remove: fix removing packages with deltas

We have code in order to remove deltas when removing a package, but it
is never run, since we try to remove the wrong file.

This was broken in commit cb0f2bd038 which
modified the internal layout we use to modify the db, changing "tree" to
"db", but did not update all locations where it was used.

This worked swimmingly well as long as only repo-add updates were
handling the backup and restore of the delta file, as the delta file
therefore got backed up to the correct location (db) in the shared
db_remove_entry() function.

But later on in the repo-remove logic, we tried removing a different
file that will never exist (tree).

Fixes FS#53041

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2018-12-26 22:58:26 -05:00 committed by Allan McRae
parent 2d403709d9
commit 4778f13188

View file

@ -611,7 +611,7 @@ remove() {
msg "$(gettext "Searching for package '%s'...")" "$pkgname" msg "$(gettext "Searching for package '%s'...")" "$pkgname"
if db_remove_entry "$pkgname"; then if db_remove_entry "$pkgname"; then
rm -f "$tmpdir/tree/$pkgname.deltas" rm -f "$tmpdir/db/$pkgname.deltas"
return 0 return 0
else else
error "$(gettext "Package matching '%s' not found.")" "$pkgname" error "$(gettext "Package matching '%s' not found.")" "$pkgname"