--- tar.c Fri Oct 16 12:41:25 1998 +++ tar.c.orig Sun Oct 18 20:19:56 1998 @@ -16,10 +16,6 @@ with this program; if not, write to the Free Software Foundation, Inc., 59 Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* 13 Oct 97: patched by Hiroshi Takekawa to integrate bzip2 as - compression filter (option -I) */ -/* 1 Aug 98: hacked by Ang Chin Han (angch) to autodetect and handle - compressed tar archives */ #include "system.h" #include @@ -200,8 +196,6 @@ {"block-number", no_argument, NULL, 'R'}, {"block-size", required_argument, NULL, OBSOLETE_BLOCKING_FACTOR}, {"blocking-factor", required_argument, NULL, 'b'}, - {"bzip2", required_argument, NULL, 'I'}, - {"bunzip2", required_argument, NULL, 'I'}, {"catenate", no_argument, NULL, 'A'}, {"checkpoint", no_argument, &checkpoint_option, 1}, {"compare", no_argument, NULL, 'd'}, @@ -378,7 +372,6 @@ PATTERN at list/extract time, a globbing PATTERN\n\ -o, --old-archive, --portability write a V7 format archive\n\ --posix write a POSIX conformant archive\n\ - -I, --bzip2, --bunzip2 filter the archive through bzip2\n\ -z, --gzip, --ungzip filter the archive through gzip\n\ -Z, --compress, --uncompress filter the archive through compress\n\ --use-compress-program=PROG filter through PROG (must accept -d)\n"), @@ -455,7 +448,7 @@ Y per-block gzip compression */ #define OPTION_STRING \ - "-01234567ABC:F:GIK:L:MN:OPRST:UV:WX:Zb:cdf:g:hiklmoprstuvwxz" + "-01234567ABC:F:GK:L:MN:OPRST:UV:WX:Zb:cdf:g:hiklmoprstuvwxz" static void set_subcommand_option (enum subcommand subcommand) @@ -471,12 +464,9 @@ static void set_use_compress_program_option (const char *string) { -/* - * Commented out by angch: because autodetected option should overwrite - * specified option if (use_compress_program_option && strcmp (use_compress_program_option, string) != 0) USAGE_ERROR ((0, 0, _("Conflicting compression options"))); -*/ + use_compress_program_option = string; } @@ -631,30 +621,6 @@ sizeof (const char *) * allocated_archive_names); } archive_name_array[archive_names++] = optarg; - - /* angch hack for file type detection */ - { - int c[4], i; - FILE* f = fopen(optarg, "r"); - - if (f != NULL) { - for (i = 0; i < 4; i++) - c[i] = fgetc(f); - - if (c[0] == 'B' && c[1] == 'Z' && c[2] == 'h') { - /* BZIP2 compressed */ - set_use_compress_program_option ("bzip2"); - } else if (c[0] == 31 && c[1] == 139) { - set_use_compress_program_option ("gzip"); - } else if (c[0] == 31 && c[1] == 157) { - set_use_compress_program_option ("compress"); - } - - fclose(f); - } - } - /* end angch hack */ - break; case 'F': @@ -839,9 +805,6 @@ case 'X': exclude_option = 1; add_exclude_file (optarg); - break; - case 'I': - set_use_compress_program_option ("bzip2"); break; case 'z':