doesn't have a compression library such as gzip nor bzip2.
SVN-Revision: 811
break;
#endif
case 'y': /* tar convention */
+#if HAVE_LIBBZ2
cpio->compress = opt;
+#else
+ cpio_warnc(0, "bzip2 compression not supported by "
+ "this version of bsdcpio");
+#endif
break;
case 'Z': /* tar convention */
cpio->compress = opt;
break;
case 'z': /* tar convention */
+#if HAVE_LIBZ
cpio->compress = opt;
+#else
+ cpio_warnc(0, "gzip compression not supported by "
+ "this version of bsdcpio");
+#endif
break;
default:
usage();
testprog);
failure("-y (bzip) option seems to be broken");
if (assertEqualInt(r, 0)) {
- assertTextFileContents("1 block\n", "archive.err");
- /* Check that the archive file has a bzip2 signature. */
- p = slurpfile(&s, "archive.out");
- assert(s > 2);
- assertEqualMem(p, "BZh9", 4);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (strstr(p, "bzip2 compression not supported") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without bzip2 support");
+ } else {
+ assertTextFileContents("1 block\n", "archive.err");
+ /* Check that the archive file has a bzip2 signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "BZh9", 4);
+ }
}
}
failure("-z option seems to be broken");
assertEqualInt(r, 0);
if (r == 0) {
- /* Check that the archive file has a gzip signature. */
- p = slurpfile(&s, "archive.out");
- assert(s > 2);
- assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+ p = slurpfile(&s, "archive.err");
+ p[s] = '\0';
+ if (strstr(p, "gzip compression not supported") != NULL) {
+ skipping("This version of bsdcpio was compiled "
+ "without gzip support");
+ } else {
+ /* Check that the archive file has a gzip signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+ }
}
}