From: Tilman Sauerbeck Date: Wed, 6 Dec 2006 20:17:49 +0000 (+0100) Subject: Set ARCHIVE_EXTRACT_UNLINK when extracting archive entries. X-Git-Url: http://gitweb/?a=commitdiff_plain;h=2a62ed9ad2688a873bc7773b2c3cf818456aeabb;p=pkgutils-cross.git Set ARCHIVE_EXTRACT_UNLINK when extracting archive entries. --- diff --git a/pkgutil.cc b/pkgutil.cc index f5b430d..62a9edf 100644 --- a/pkgutil.cc +++ b/pkgutil.cc @@ -422,8 +422,9 @@ void pkgutil::pkg_install(const string& filename, const set& keep_list, (real_filename.c_str())); // Extract file - if (archive_read_extract(archive, entry, ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM) != - ARCHIVE_OK) { + unsigned int flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_UNLINK; + + if (archive_read_extract(archive, entry, flags) != ARCHIVE_OK) { // If a file fails to install we just print an error message and // continue trying to install the rest of the package. const char* msg = archive_error_string(archive);