xbps: merge 2 patches from git master.

This commit is contained in:
Juan RP 2013-02-05 12:15:41 +01:00
parent 0f072b4d76
commit 4bf788e170
3 changed files with 97 additions and 1 deletions

View file

@ -0,0 +1,32 @@
From 6c96fe32ccff435d42ff19ef8c7755beb25bfd97 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Tue, 5 Feb 2013 09:32:43 +0100
Subject: [PATCH 1/2] lib/initend.c: print dbg msg about successful vpkg conf
files read.
---
lib/initend.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/initend.c b/lib/initend.c
index 6f66ded..e38edc1 100644
--- lib/initend.c
+++ lib/initend.c
@@ -108,12 +108,13 @@ config_inject_vpkgs(struct xbps_handle *xh)
path = xbps_xasprintf("%s/%s", vpkgdir, dp->d_name);
fp = fopen(path, "r");
assert(fp);
- free(path);
if (cfg_parse_fp(xh->cfg, fp) != 0) {
xbps_error_printf("Failed to parse "
"vpkg conf file %s:\n", dp->d_name);
}
fclose(fp);
+ xbps_dbg_printf(xh, "Injected vpkgs from %s\n", path);
+ free(path);
}
}
closedir(dirp);
--
1.8.1.1

View file

@ -0,0 +1,64 @@
From d8769c487352df81cf89f3ae2898e38933d2026f Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Tue, 5 Feb 2013 12:10:24 +0100
Subject: [PATCH 2/2] Workaround fix for 'xbps-install -yf xbps <-> xbps-git'.
---
NEWS | 3 +++
include/xbps_api.h.in | 4 ++--
lib/package_unpack.c | 5 +++--
lib/transaction_commit.c | 2 +-
lib/transaction_package_replace.c | 3 +--
5 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/package_unpack.c b/lib/package_unpack.c
index 8e78e59..3708951 100644
--- lib/package_unpack.c
+++ lib/package_unpack.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2008-2012 Juan Romero Pardines.
+ * Copyright (c) 2008-2013 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -491,7 +491,8 @@ unpack_archive(struct xbps_handle *xhp,
* - Package with "softreplace" keyword.
*/
old_filesd = xbps_pkgdb_get_pkg_metadata(xhp, pkgname);
- assert(prop_object_type(old_filesd) == PROP_TYPE_DICTIONARY);
+ if (old_filesd == NULL)
+ goto out1;
obsoletes = xbps_find_pkg_obsoletes(xhp, old_filesd, filesd);
for (i = 0; i < prop_array_count(obsoletes); i++) {
diff --git a/lib/transaction_commit.c b/lib/transaction_commit.c
index dd7b7b6..84c079a 100644
--- lib/transaction_commit.c
+++ lib/transaction_commit.c
@@ -264,7 +264,7 @@ xbps_transaction_commit(struct xbps_handle *xhp)
else
install = true;
- if (update) {
+ if (update && xbps_pkgdb_get_pkg(xhp, pkgname)) {
/*
* Update a package: execute pre-remove
* action if found before unpacking.
diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c
index 98f43a5..052eff3 100644
--- lib/transaction_package_replace.c
+++ lib/transaction_package_replace.c
@@ -92,8 +92,7 @@ xbps_transaction_package_replace(struct xbps_handle *xhp)
* package that should be replaced is also in the
* transaction and it's going to be updated.
*/
- if ((reppkgd = xbps_find_pkg_in_array(unsorted, curpkgname)) ||
- (reppkgd = xbps_find_virtualpkg_in_array(xhp, unsorted, curpkgname))) {
+ if ((reppkgd = xbps_find_pkg_in_array(unsorted, curpkgname))) {
xbps_dbg_printf(xhp,
"found replaced pkg "
"in transaction\n");
--
1.8.1.1

View file

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.20
revision=7
revision=8
build_style=configure
configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin
--enable-tests --enable-static --enable-debug"