void-packages/srcpkgs/xbps/patches/0007-Workaround-fix-for-xbp...

65 lines
2.3 KiB
Diff

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