lib/package_unpack.c: remove dead code (softreplace).

This commit is contained in:
Juan RP 2013-12-25 08:35:55 +01:00
parent 98748bdcd1
commit 73509b3556

View File

@ -179,7 +179,7 @@ unpack_archive(struct xbps_handle *xhp,
char *pkgname, *dname, *buf, *buf2, *p, *p2; char *pkgname, *dname, *buf, *buf2, *p, *p2;
int ar_rv, rv, entry_type, flags; int ar_rv, rv, entry_type, flags;
bool preserve, update, conf_file, file_exists, skip_obsoletes; bool preserve, update, conf_file, file_exists, skip_obsoletes;
bool softreplace, skip_extract, force, metafile, xucd_stats; bool skip_extract, force, metafile, xucd_stats;
uid_t euid; uid_t euid;
assert(xbps_object_type(pkg_repod) == XBPS_TYPE_DICTIONARY); assert(xbps_object_type(pkg_repod) == XBPS_TYPE_DICTIONARY);
@ -187,11 +187,10 @@ unpack_archive(struct xbps_handle *xhp,
propsd = filesd = old_filesd = NULL; propsd = filesd = old_filesd = NULL;
force = preserve = update = conf_file = file_exists = false; force = preserve = update = conf_file = file_exists = false;
skip_obsoletes = softreplace = metafile = xucd_stats = false; skip_obsoletes = metafile = xucd_stats = false;
xbps_dictionary_get_bool(pkg_repod, "preserve", &preserve); xbps_dictionary_get_bool(pkg_repod, "preserve", &preserve);
xbps_dictionary_get_bool(pkg_repod, "skip-obsoletes", &skip_obsoletes); xbps_dictionary_get_bool(pkg_repod, "skip-obsoletes", &skip_obsoletes);
xbps_dictionary_get_bool(pkg_repod, "softreplace", &softreplace);
xbps_dictionary_get_cstring_nocopy(pkg_repod, xbps_dictionary_get_cstring_nocopy(pkg_repod,
"transaction", &transact); "transaction", &transact);
@ -566,16 +565,15 @@ unpack_archive(struct xbps_handle *xhp,
} }
/* /*
* Skip checking for obsolete files on: * Skip checking for obsolete files on:
* - New package installation without "softreplace" keyword. * - New package installation.
* - Package with "preserve" keyword. * - Package with "preserve" keyword.
* - Package with "skip-obsoletes" keyword. * - Package with "skip-obsoletes" keyword.
*/ */
if (skip_obsoletes || preserve || (!softreplace && !update)) if (skip_obsoletes || preserve || !update)
goto out; goto out;
/* /*
* Check and remove obsolete files on: * Check and remove obsolete files on:
* - Package upgrade. * - Package upgrade.
* - Package with "softreplace" keyword.
*/ */
old_filesd = xbps_pkgdb_get_pkg_metadata(xhp, pkgname); old_filesd = xbps_pkgdb_get_pkg_metadata(xhp, pkgname);
if (old_filesd == NULL) if (old_filesd == NULL)