[pacman-dev] [PATCH] 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 cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a 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 restoral 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> --- scripts/repo-add.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index bccf2f37..1c7fb2f6 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -611,7 +611,7 @@ remove() { msg "$(gettext "Searching for package '%s'...")" "$pkgname" if db_remove_entry "$pkgname"; then - rm -f "$tmpdir/tree/$pkgname.deltas" + rm -f "$tmpdir/db/$pkgname.deltas" return 0 else error "$(gettext "Package matching '%s' not found.")" "$pkgname" -- 2.20.1
On 27/12/18 1:58 pm, Eli Schwartz wrote:
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 cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a 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 restoral 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> ---
No sure "restoral" is a word! I'll edit. A
On 1/3/19 8:14 PM, Allan McRae wrote:
On 27/12/18 1:58 pm, Eli Schwartz wrote:
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 cb0f2bd0385f447e045e2b2aab9ffa55df3c2d8a 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 restoral 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> ---
No sure "restoral" is a word! I'll edit.
No => not. :p http://www.kirkmahoney.com/blog/2008/06/restoral-vs-restoration/ They're both valid words, but I guess restoration is more commonly used... -- Eli Schwartz Bug Wrangler and Trusted User
participants (2)
-
Allan McRae
-
Eli Schwartz