From: Michihiro NAKAJIMA Date: Sat, 6 Oct 2012 04:34:51 +0000 (+0900) Subject: Revert part of d1be20168 because gunzip is still used in X-Git-Tag: v3.1.0~40^2~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4fc2b0661ceb3007aacaedd6b154d61a7898aab;p=thirdparty%2Flibarchive.git Revert part of d1be20168 because gunzip is still used in test_read_filter_program and test_read_filter_program_signature, which cannot give arguments to the program. --- diff --git a/cpio/test/main.c b/cpio/test/main.c index 36cb84870..ac0347529 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -1872,6 +1872,21 @@ canGzip(void) return (value); } +/* + * Can this platform run the gunzip program? + */ +int +canGunzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("gunzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + /* * Can this platform run the lrzip program? */ diff --git a/cpio/test/test.h b/cpio/test/test.h index 45fa650d4..88c7c2438 100644 --- a/cpio/test/test.h +++ b/cpio/test/test.h @@ -272,6 +272,9 @@ int canBunzip2(void); /* Return true if this platform can run the "gzip" program. */ int canGzip(void); +/* Return true if this platform can run the "gunzip" program. */ +int canGunzip(void); + /* Return true if this platform can run the "lrzip" program. */ int canLrzip(void); diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 3ea900763..f9db14437 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -1870,6 +1870,21 @@ canGzip(void) return (value); } +/* + * Can this platform run the gunzip program? + */ +int +canGunzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("gunzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + /* * Can this platform run the lrzip program? */ diff --git a/libarchive/test/test.h b/libarchive/test/test.h index 163ea324f..eee985df4 100644 --- a/libarchive/test/test.h +++ b/libarchive/test/test.h @@ -272,6 +272,9 @@ int canBunzip2(void); /* Return true if this platform can run the "gzip" program. */ int canGzip(void); +/* Return true if this platform can run the "gunzip" program. */ +int canGunzip(void); + /* Return true if this platform can run the "lrzip" program. */ int canLrzip(void); diff --git a/libarchive/test/test_read_filter_program.c b/libarchive/test/test_read_filter_program.c index 66266a773..710767b18 100644 --- a/libarchive/test/test_read_filter_program.c +++ b/libarchive/test/test_read_filter_program.c @@ -61,8 +61,8 @@ DEFINE_TEST(test_read_filter_program) /* * If we have "gzip -d", try using that. */ - if (!canGzip()) { - skipping("Can't run gzip program on this platform"); + if (!canGunzip()) { + skipping("Can't run gunzip program on this platform"); return; } assert((a = archive_read_new()) != NULL); diff --git a/libarchive/test/test_read_filter_program_signature.c b/libarchive/test/test_read_filter_program_signature.c index 4f966a252..0512560ee 100644 --- a/libarchive/test/test_read_filter_program_signature.c +++ b/libarchive/test/test_read_filter_program_signature.c @@ -64,8 +64,8 @@ DEFINE_TEST(test_read_filter_program_signature) /* * If we have "gzip -d", try using that. */ - if (!canGzip()) { - skipping("Can't run gzip program on this platform"); + if (!canGunzip()) { + skipping("Can't run gunzip program on this platform"); return; } assert((a = archive_read_new()) != NULL); diff --git a/tar/test/main.c b/tar/test/main.c index 42cf272d3..140939321 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -1872,6 +1872,21 @@ canGzip(void) return (value); } +/* + * Can this platform run the gunzip program? + */ +int +canGunzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("gunzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + /* * Can this platform run the lrzip program? */ diff --git a/tar/test/test.h b/tar/test/test.h index dc23fc96a..05d99c2a2 100644 --- a/tar/test/test.h +++ b/tar/test/test.h @@ -274,6 +274,9 @@ int canBunzip2(void); /* Return true if this platform can run the "gzip" program. */ int canGzip(void); +/* Return true if this platform can run the "gunzip" program. */ +int canGunzip(void); + /* Return true if this platform can run the "lrzip" program. */ int canLrzip(void);