From d8769c487352df81cf89f3ae2898e38933d2026f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 5 Feb 2013 12:10:24 +0100 Subject: [PATCH] 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/NEWS b/NEWS index 9687998a..47658720 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.21 (???): + * libxbps: workaround a bug (found by pancake) when updating a package + that is being replaced by a virtual package. + * libxbps: fully remove packages with broken symlinks; previously if a broken symlink was there (readlink returning ELOOP), package wasn't removed. diff --git a/include/xbps_api.h.in b/include/xbps_api.h.in index 39d61b8e..56a12251 100644 --- a/include/xbps_api.h.in +++ b/include/xbps_api.h.in @@ -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 @@ -64,7 +64,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.6" -#define XBPS_API_VERSION "20130202" +#define XBPS_API_VERSION "20130205" #ifndef XBPS_VERSION #define XBPS_VERSION "UNSET" diff --git a/lib/package_unpack.c b/lib/package_unpack.c index 8e78e59d..37089516 100644 --- a/lib/package_unpack.c +++ b/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 dd7b7b67..84c079a7 100644 --- a/lib/transaction_commit.c +++ b/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 98f43a5a..052eff3d 100644 --- a/lib/transaction_package_replace.c +++ b/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");