← Commit list

873bb31d1

Pascal Bellard
Pascal Bellard
2010-10-18
FAILED Duration: 268s

Subject

cpio: avoid 'not created: newer or same age file exists' message for dirs

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/libunarchive/data_extract_all.c+3 -1
@@ -69,7 +69,9 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
}
}
else if (existing_sb.st_mtime >= file_header->mtime) {
- if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) {
+ if (!(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
+ && !S_ISDIR(file_header->mode)
+ ) {
bb_error_msg("%s not created: newer or "
"same age file exists", file_header->name);
}
testsuite/cpio.tests+10 -0
@@ -116,6 +116,16 @@ link
" "" ""
SKIP=
+# avoid 'not created: newer or same age file exists' message for directories
+rm -rf cpio.testdir cpio.testdir2 2>/dev/null
+mkdir cpio.testdir
+testing "cpio extracts in existing directory" \
+"$ECHO -ne '$hexdump' | bzcat | cpio -id 2>&1; echo \$?" \
+"\
+1 blocks
+0
+" "" ""
+SKIP=
# Clean up
rm -rf cpio.testdir cpio.testdir2 2>/dev/null