(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);