diff --git a/lib/package_unpack.c b/lib/package_unpack.c index 568e77bd..bcc54e16 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -87,17 +87,16 @@ unpack_archive(struct xbps_handle *xhp, const char *file, *entry_pname, *transact; char *pkgname, *buf; int ar_rv, rv, error, entry_type, flags; - bool preserve, update, file_exists, skip_obsoletes; + bool preserve, update, file_exists; bool skip_extract, force, xucd_stats; uid_t euid; binpkg_filesd = pkg_filesd = NULL; force = preserve = update = file_exists = false; - skip_obsoletes = xucd_stats = false; + xucd_stats = false; ar_rv = rv = error = entry_type = flags = 0; xbps_dictionary_get_bool(pkg_repod, "preserve", &preserve); - xbps_dictionary_get_bool(pkg_repod, "skip-obsoletes", &skip_obsoletes); xbps_dictionary_get_cstring_nocopy(pkg_repod, "transaction", &transact); memset(&xucd, 0, sizeof(xucd)); @@ -475,10 +474,9 @@ unpack_archive(struct xbps_handle *xhp, /* * Skip checking for obsolete files on: * - Package with "preserve" keyword. - * - Package with "skip-obsoletes" keyword. */ - if (skip_obsoletes || preserve) { - xbps_dbg_printf(xhp, "%s: skipping obsoletes\n", pkgver); + if (preserve) { + xbps_dbg_printf(xhp, "%s: preserved package, skipping obsoletes\n", pkgver); goto out; } /* diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c index 031f19a5..087f88d3 100644 --- a/lib/transaction_package_replace.c +++ b/lib/transaction_package_replace.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011-2014 Juan Romero Pardines. + * Copyright (c) 2011-2015 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,8 +99,6 @@ xbps_transaction_package_replace(struct xbps_handle *xhp, xbps_array_t pkgs) */ xbps_dictionary_set_bool(reppkgd, "automatic-install", instd_auto); - xbps_dictionary_set_bool(reppkgd, - "skip-obsoletes", true); xbps_array_replace_dict_by_name(pkgs, reppkgd, curpkgname); continue; diff --git a/tests/xbps/libxbps/shell/obsoletefiles_test.sh b/tests/xbps/libxbps/shell/obsoletefiles_test.sh index e374ddb9..053076fa 100644 --- a/tests/xbps/libxbps/shell/obsoletefiles_test.sh +++ b/tests/xbps/libxbps/shell/obsoletefiles_test.sh @@ -169,7 +169,11 @@ files_move_to_dependency_body() { xbps-install -r root --repository=$PWD -yvd libressl atf_check_equal $? 0 + sleep 1 rm -rf ../pkg_libressl/* + touch -f ../pkg_libcrypto/usr/lib/libcrypto.so.30 + xbps-create -A noarch -n libcrypto-1.1_1 -s "libcrypto pkg" --replaces "libressl<1.1_1" ../pkg_libcrypto + atf_check_equal $? 0 xbps-create -A noarch -n libressl-1.1_1 -s "libressl pkg" --dependencies "libcrypto>=1.0" ../pkg_libressl atf_check_equal $? 0 xbps-rindex -d -a $PWD/*.xbps