diff options
author | joerg <joerg@pkgsrc.org> | 2010-02-20 03:48:25 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2010-02-20 03:48:25 +0000 |
commit | 813e1c65cfea70db0fa02bd006013a08731f470f (patch) | |
tree | f2e9909a57c8ba8f986b13e36ed04e225fc44b2a /archivers/libarchive/files/cpio/test/test_option_m.c | |
parent | a3bb8bd3027e67eb07c16f479613f290fb214f4a (diff) | |
download | pkgsrc-813e1c65cfea70db0fa02bd006013a08731f470f.tar.gz |
Import libarchive 2.8.0:
- Infrastructure:
- Allow command line tools as fallback for missing compression
libraries. If compiled without gzip for example, gunzip will
be used automatically.
- Improved support for a number of platforms like high-resolution
timestamps and Extended Attributes on various Unix systems
- New convience interface for creating archives based on disk content,
complement of the archive_write_disk interface.
- Frontends:
- bsdcpio ready for public consumption
- hand-written date parser replaces the yacc code
- Filter system:
- Simplified read filter chains
- Option support for filters
- LZMA, XZ, uudecode handled
- Format support:
- Write support for mtree files based on file system or archive
content
- Basic read support for Joliet
- Write support for zip files
- Write support for shar archives, both text-only and binary-safe
Diffstat (limited to 'archivers/libarchive/files/cpio/test/test_option_m.c')
-rw-r--r-- | archivers/libarchive/files/cpio/test/test_option_m.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/archivers/libarchive/files/cpio/test/test_option_m.c b/archivers/libarchive/files/cpio/test/test_option_m.c index d5bbad2e902..de880b2883e 100644 --- a/archivers/libarchive/files/cpio/test/test_option_m.c +++ b/archivers/libarchive/files/cpio/test/test_option_m.c @@ -28,9 +28,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_option_m) { - struct stat st; int r; - time_t now; /* * The reference archive has one file with an mtime in 1970, 1 @@ -38,33 +36,28 @@ DEFINE_TEST(test_option_m) */ /* Restored without -m, the result should have a current mtime. */ - assertEqualInt(0, mkdir("without-m", 0755)); - assertEqualInt(0, chdir("without-m")); + assertMakeDir("without-m", 0755); + assertChdir("without-m"); extract_reference_file("test_option_m.cpio"); - r = systemf("%s -i < test_option_m.cpio >out 2>err", testprog); - now = time(NULL); + r = systemf("%s --no-preserve-owner -i < test_option_m.cpio >out 2>err", testprog); assertEqualInt(r, 0); assertEmptyFile("out"); - assertFileContents("1 block\n", 8, "err"); - assertEqualInt(0, stat("file", &st)); + assertTextFileContents("1 block\n", "err"); /* Should have been created within the last few seconds. */ - assert(st.st_mtime <= now); - assert(st.st_mtime > now - 5); + assertFileMtimeRecent("file"); /* With -m, it should have an mtime in 1970. */ - assertEqualInt(0, chdir("..")); - assertEqualInt(0, mkdir("with-m", 0755)); - assertEqualInt(0, chdir("with-m")); + assertChdir(".."); + assertMakeDir("with-m", 0755); + assertChdir("with-m"); extract_reference_file("test_option_m.cpio"); - r = systemf("%s -im < test_option_m.cpio >out 2>err", testprog); - now = time(NULL); + r = systemf("%s --no-preserve-owner -im < test_option_m.cpio >out 2>err", testprog); assertEqualInt(r, 0); assertEmptyFile("out"); - assertFileContents("1 block\n", 8, "err"); - assertEqualInt(0, stat("file", &st)); + assertTextFileContents("1 block\n", "err"); /* * mtime in reference archive is '1' == 1 second after * midnight Jan 1, 1970 UTC. */ - assertEqualInt(1, st.st_mtime); + assertFileMtime("file", 1, 0); } |