From a35c42b6202943b1985db8302159eba5bd041f7a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 29 Dec 2012 07:18:49 +0100 Subject: [PATCH] xbps: new patch to fully remove a pkg even if pre-remove action fails. --- ...executing-a-pre-remove-action-fails-.patch | 53 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/0002-libxbps-even-if-executing-a-pre-remove-action-fails-.patch diff --git a/srcpkgs/xbps/patches/0002-libxbps-even-if-executing-a-pre-remove-action-fails-.patch b/srcpkgs/xbps/patches/0002-libxbps-even-if-executing-a-pre-remove-action-fails-.patch new file mode 100644 index 00000000000..a6aa29dfddf --- /dev/null +++ b/srcpkgs/xbps/patches/0002-libxbps-even-if-executing-a-pre-remove-action-fails-.patch @@ -0,0 +1,53 @@ +From 5d59a15faf67d921dfb190195c07bf4a70bca137 Mon Sep 17 00:00:00 2001 +From: Juan RP +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 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 960ac9e4a92..7d07673e90a 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -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"