diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile index 57ff44705225..e37312075ed7 100644 --- a/usr.bin/ar/Makefile +++ b/usr.bin/ar/Makefile @@ -3,8 +3,8 @@ PROG= ar SRCS= ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} ${LIBELF} -LDADD= -larchive -lbz2 -lz -llzma -lelf +DPADD= ${LIBARCHIVE} ${LIBELF} +LDADD= -larchive -lelf CFLAGS+=-I. -I${.CURDIR} diff --git a/usr.bin/ar/acpyacc.y b/usr.bin/ar/acpyacc.y index b686c3f57475..e1a6e6d517c5 100644 --- a/usr.bin/ar/acpyacc.y +++ b/usr.bin/ar/acpyacc.y @@ -250,7 +250,7 @@ arscp_open(char *fname) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_file(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) diff --git a/usr.bin/ar/ar.1 b/usr.bin/ar/ar.1 index 250cd20f90bd..6e00228edb05 100644 --- a/usr.bin/ar/ar.1 +++ b/usr.bin/ar/ar.1 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2007 +.Dd May 17, 2010 .Dt AR 1 .Os .Sh NAME @@ -186,8 +186,7 @@ Synonymous with option Synonymous with option .Fl b . .It Fl j -Compress the resulting archive with -.Xr bzip2 1 . +This option is accepted but ignored. .It Fl m Move archive members specified by arguments .Ar files ... @@ -344,8 +343,7 @@ of extraction unless the .Fl o option was specified. .It Fl z -Compress the resulting archive with -.Xr gzip 1 . +This option is accepted but ignored. .El .Sh EXAMPLES To create a new archive diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c index dc4b6c4a7606..1fe92fbef3d8 100644 --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -178,7 +178,7 @@ main(int argc, char **argv) bsdar->options |= AR_TR; break; case 'j': - bsdar->options |= AR_J; + /* ignored */ break; case 'l': /* ignored, for GNU ar comptibility */ @@ -223,7 +223,7 @@ main(int argc, char **argv) set_mode(bsdar, opt); break; case 'z': - bsdar->options |= AR_Z; + /* ignored */ break; case OPTION_HELP: bsdar_usage(); diff --git a/usr.bin/ar/ar.h b/usr.bin/ar/ar.h index 111f944a83e3..60fe8e8ef01f 100644 --- a/usr.bin/ar/ar.h +++ b/usr.bin/ar/ar.h @@ -81,7 +81,6 @@ struct bsdar { const char *addlib; /* target of ADDLIB. */ const char *posarg; /* position arg for modifiers -a, -b. */ char mode; /* program mode */ - char compression; /* compression mode */ int options; /* command line options */ const char *progname; /* program name */ diff --git a/usr.bin/ar/read.c b/usr.bin/ar/read.c index 37bd0a18932a..8df170dc455e 100644 --- a/usr.bin/ar/read.c +++ b/usr.bin/ar/read.c @@ -87,7 +87,7 @@ read_archive(struct bsdar *bsdar, char mode) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_file(a, bsdar->filename, DEF_BLKSZ)); diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index 3d4f93d9abc5..8b6fbdf5a2c5 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -247,7 +247,7 @@ read_objs(struct bsdar *bsdar, const char *archive, int checkargv) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_filename(a, archive, DEF_BLKSZ)); for (;;) { @@ -264,13 +264,6 @@ read_objs(struct bsdar *bsdar, const char *archive, int checkargv) continue; } - /* - * Remember the compression mode of existing archive. - * If neither -j nor -z is specified, this mode will - * be used for resulting archive. - */ - bsdar->compression = archive_compression(a); - name = archive_entry_pathname(entry); /* @@ -360,9 +353,6 @@ write_archive(struct bsdar *bsdar, char mode) pos = NULL; memset(&sb, 0, sizeof(sb)); - /* By default, no compression is assumed. */ - bsdar->compression = ARCHIVE_COMPRESSION_NONE; - /* * Test if the specified archive exists, to figure out * whether we are creating one here. @@ -618,23 +608,7 @@ write_objs(struct bsdar *bsdar) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); - - /* The compression mode of the existing archive is used - * for the result archive or if creating a new archive, we - * do not compress archive by default. This default behavior can - * be overrided by compression mode specified explicitly - * through command line option `-j' or `-z'. - */ - if (bsdar->options & AR_J) - bsdar->compression = ARCHIVE_COMPRESSION_BZIP2; - if (bsdar->options & AR_Z) - bsdar->compression = ARCHIVE_COMPRESSION_GZIP; - if (bsdar->compression == ARCHIVE_COMPRESSION_BZIP2) - archive_write_set_compression_bzip2(a); - else if (bsdar->compression == ARCHIVE_COMPRESSION_GZIP) - archive_write_set_compression_gzip(a); - else - archive_write_set_compression_none(a); + archive_write_set_compression_none(a); AC(archive_write_open_filename(a, bsdar->filename));