diff --git a/NEWS b/NEWS index 72a63b91..9c87be66 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,9 @@ -xbps-0.12.1 (2012-02-14): +xbps-0.13.0 (???): + + * libxbps: skip checking for obsolete files if a package in a transaction + replaces another one that is going to be updated. In such cases that means + new package now owns some files previously owned by the package to be + updated, therefore the updated package must not check for obsolete files. * xbps-repo(8): the `show', `show-deps' and `show-files' targets now accept package patterns, i.e "xbps-repo show 'foo>=2.0'". If only a `pkgname` diff --git a/include/xbps_api.h b/include/xbps_api.h index c0578e4c..680cd61f 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,8 +56,8 @@ */ #define XBPS_PKGINDEX_VERSION "1.4" -#define XBPS_API_VERSION "20120214-1" -#define XBPS_VERSION "0.12" +#define XBPS_API_VERSION "20120220" +#define XBPS_VERSION "0.13" /** * @def XBPS_RELVER diff --git a/lib/package_unpack.c b/lib/package_unpack.c index 9062f4f1..f81255f8 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -164,13 +164,14 @@ unpack_archive(prop_dictionary_t pkg_repod, struct archive *ar) const char *entry_pname, *transact, *pkgname, *version, *pkgver, *fname; char *buf = NULL, *pkgfilesd = NULL; int rv, flags; - bool preserve, update, conf_file, file_exists; + bool preserve, update, conf_file, file_exists, skip_obsoletes; assert(prop_object_type(pkg_repod) == PROP_TYPE_DICTIONARY); assert(ar != NULL); - preserve = update = conf_file = file_exists = false; + preserve = update = conf_file = file_exists = skip_obsoletes = false; prop_dictionary_get_bool(pkg_repod, "preserve", &preserve); + prop_dictionary_get_bool(pkg_repod, "skip-obsoletes", &skip_obsoletes); prop_dictionary_get_cstring_nocopy(pkg_repod, "transaction", &transact); prop_dictionary_get_cstring_nocopy(pkg_repod, "pkgname", &pkgname); @@ -474,8 +475,10 @@ unpack_archive(prop_dictionary_t pkg_repod, struct archive *ar) goto out; } /* - * On pkgs that set the preserve keyword or while installing - * new packages, do not check for obsolete files. + * Skip checking for obsolete files on: + * - New package installation. + * - Package with "preserve" keyword. + * - Package with "skip-obsoletes" keyword. */ pkgfilesd = xbps_xasprintf("%s/metadata/%s/%s", XBPS_META_PATH, pkgname, XBPS_PKGFILES); @@ -483,7 +486,7 @@ unpack_archive(prop_dictionary_t pkg_repod, struct archive *ar) rv = ENOMEM; goto out; } - if (preserve || !update) + if (skip_obsoletes || preserve || !update) goto out1; /* * Check for obsolete files. diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c index 4f8560aa..f5a19730 100644 --- a/lib/transaction_package_replace.c +++ b/lib/transaction_package_replace.c @@ -118,6 +118,8 @@ xbps_transaction_package_replace(prop_dictionary_t transd) } prop_dictionary_set_bool(reppkgd, "automatic-install", instd_auto); + prop_dictionary_set_bool(reppkgd, + "skip-obsoletes", true); xbps_array_replace_dict_by_name(transd_unsorted, reppkgd, curpkgname); }