]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Revert part of d1be20168 because gunzip is still used in
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 6 Oct 2012 04:34:51 +0000 (13:34 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 6 Oct 2012 04:34:51 +0000 (13:34 +0900)
test_read_filter_program and test_read_filter_program_signature,
which cannot give arguments to the program.

cpio/test/main.c
cpio/test/test.h
libarchive/test/main.c
libarchive/test/test.h
libarchive/test/test_read_filter_program.c
libarchive/test/test_read_filter_program_signature.c
tar/test/main.c
tar/test/test.h

index 36cb84870a0748e4bc7a91946f32252e7e5f2b36..ac03475297973db6f597f7c260966674e0509beb 100644 (file)
@@ -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?
  */
index 45fa650d4d38f0ce1b8966962966c50c3eb090ca..88c7c243811efed8c044f3730e5d726b6af5a88b 100644 (file)
@@ -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);
 
index 3ea9007634cfbdb6988573bc8e646898b6801bf6..f9db144377e8cfe0e03aa7c7fdb06ce527a7c2f5 100644 (file)
@@ -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?
  */
index 163ea324f9712475359b8a5e496234dabfde4151..eee985df4c1b408d041e74126344add766812099 100644 (file)
@@ -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);
 
index 66266a7734a0ff42206ae512b4f8a9285c336ca6..710767b18d025605edf7d35c59d2a9581dd664bc 100644 (file)
@@ -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);
index 4f966a252a8f470a3a4f96223d13c14678c9afdc..0512560ee587ab86673b15023764c40a8ea421d0 100644 (file)
@@ -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);
index 42cf272d386dab55aa5d51db4d144052f61e4e04..140939321f2e07d4f303e9b1883d7a104316dbf3 100644 (file)
@@ -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?
  */
index dc23fc96a488992df4c3c8e648451260147468a8..05d99c2a248bb68a23a43abf892a71899b20ee12 100644 (file)
@@ -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);