xbps: new patch to fully remove a pkg even if pre-remove action fails.

This commit is contained in:
Juan RP 2012-12-29 07:18:49 +01:00
parent a4722598c9
commit a35c42b620
2 changed files with 54 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 5d59a15faf67d921dfb190195c07bf4a70bca137 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Sat, 29 Dec 2012 07:13:49 +0100
Subject: [PATCH] libxbps: even if executing a pre-remove action fails,
continue removing pkg.
This is no reason to stop removing a pkg, so just continue and fully
remove the pkg.
---
lib/package_remove.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/package_remove.c b/lib/package_remove.c
index 3118e19..a207fc0 100644
--- lib/package_remove.c
+++ lib/package_remove.c
@@ -266,7 +266,7 @@ xbps_remove_pkg(struct xbps_handle *xhp,
"execute pre ACTION: %s",
pkgver, strerror(errno));
rv = errno;
- goto out;
+ goto purge;
}
}
/*
@@ -349,6 +349,7 @@ purge:
*/
buf = xbps_xasprintf("%s/.%s.plist", xhp->metadir, pkgname);
if (remove(buf) == -1) {
+ free(buf);
if (errno != ENOENT) {
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_FAIL,
rv, pkgname, version,
@@ -356,6 +357,7 @@ purge:
pkgver, strerror(errno));
}
}
+ free(buf);
/*
* Unregister package from pkgdb.
*/
@@ -367,8 +369,6 @@ purge:
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE,
0, pkgname, version, NULL);
out:
- if (buf != NULL)
- free(buf);
if (pkgname != NULL)
free(pkgname);
--
1.8.0.3

View File

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.19.1
revision=2
revision=3
build_style=configure
configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin
--with-tests --with-static"