xbps: merge patches from master to fix the libgudev fallout.

This commit is contained in:
Juan RP 2015-10-14 11:54:51 +02:00
parent 866c681a56
commit c980b17078
3 changed files with 103 additions and 1 deletions

View file

@ -0,0 +1,29 @@
From 28f01b38365c407736aec0590920203f25ff18b9 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@voidlinux.eu>
Date: Sun, 26 Jul 2015 08:15:07 +0200
Subject: [PATCH 05/30] xbps_transaction_package_replace: fix a resource leak
(CID #98688).
---
lib/transaction_package_replace.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- lib/transaction_package_replace.c
+++ lib/transaction_package_replace.c
@@ -121,8 +121,12 @@ xbps_transaction_package_replace(struct xbps_handle *xhp, xbps_array_t pkgs)
*/
xbps_dictionary_set_cstring_nocopy(instd,
"transaction", "remove");
- if (!xbps_array_add_first(pkgs, instd))
+ if (!xbps_array_add_first(pkgs, instd)) {
+ xbps_object_iterator_release(iter);
+ free(pkgname);
+ free(curpkgname);
return EINVAL;
+ }
free(curpkgname);
}
xbps_object_iterator_release(iter);
--
2.6.1

View file

@ -0,0 +1,73 @@
From c457b594aa29b6980e3887ee309d2df96a89884c Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@voidlinux.eu>
Date: Wed, 14 Oct 2015 11:46:56 +0200
Subject: [PATCH] libxbps: fix eudev-libgudev -> libgudev fallout.
Packages to be replaced must be collected *before* checking for
broken reverse dependencies, otherwise them will always be detected
as broken.
---
NEWS | 3 +++
lib/transaction_dictionary.c | 16 ++++++++--------
lib/transaction_package_replace.c | 1 +
lib/transaction_revdeps.c | 4 ++++
4 files changed, 16 insertions(+), 8 deletions(-)
--- lib/transaction_dictionary.c
+++ lib/transaction_dictionary.c
@@ -300,6 +300,14 @@ xbps_transaction_prepare(struct xbps_handle *xhp)
xbps_object_release(edges);
/*
+ * Check for packages to be replaced.
+ */
+ if ((rv = xbps_transaction_package_replace(xhp, pkgs)) != 0) {
+ xbps_object_release(xhp->transd);
+ xhp->transd = NULL;
+ return rv;
+ }
+ /*
* If there are missing deps or revdeps bail out.
*/
xbps_transaction_revdeps(xhp, pkgs);
@@ -331,14 +339,6 @@ xbps_transaction_prepare(struct xbps_handle *xhp)
}
}
/*
- * Check for packages to be replaced.
- */
- if ((rv = xbps_transaction_package_replace(xhp, pkgs)) != 0) {
- xbps_object_release(xhp->transd);
- xhp->transd = NULL;
- return rv;
- }
- /*
* Add transaction stats for total download/installed size,
* number of packages to be installed, updated, configured
* and removed to the transaction dictionary.
--- lib/transaction_package_replace.c
+++ lib/transaction_package_replace.c
@@ -121,6 +121,7 @@ xbps_transaction_package_replace(struct xbps_handle *xhp, xbps_array_t pkgs)
*/
xbps_dictionary_set_cstring_nocopy(instd,
"transaction", "remove");
+ xbps_dictionary_set_bool(instd, "replaced", true);
if (!xbps_array_add_first(pkgs, instd)) {
xbps_object_iterator_release(iter);
free(pkgname);
--- lib/transaction_revdeps.c
+++ lib/transaction_revdeps.c
@@ -166,6 +166,10 @@ xbps_transaction_revdeps(struct xbps_handle *xhp, xbps_array_t pkgs)
* the transaction.
*/
if (strcmp(tract, "remove") == 0) {
+ if (xbps_dictionary_get(obj, "replaced")) {
+ free(pkgname);
+ continue;
+ }
if (xbps_find_pkg_in_array(pkgs, pkgname, "remove")) {
free(pkgname);
continue;
--
2.6.1

View file

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.47
revision=3
revision=4
bootstrap=yes
build_style=configure
short_desc="The XBPS package system utilities"