CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Set ARCHIVE_EXTRACT_UNLINK when extracting archive entries.
authorTilman Sauerbeck <tilman@crux.nu>
Wed, 6 Dec 2006 20:17:49 +0000 (21:17 +0100)
committerTilman Sauerbeck <tilman@crux.nu>
Wed, 6 Dec 2006 20:17:49 +0000 (21:17 +0100)
pkgutil.cc

index f5b430da72d6961c0879964c3a66d9f8ba6f5d2c..62a9edf73fd08b44b3ddc651a0b0c74f1d3373eb 100644 (file)
@@ -422,8 +422,9 @@ void pkgutil::pkg_install(const string& filename, const set<string>& 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);