diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-01-02 00:27:14 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-01-02 00:27:14 +0000 |
commit | 6b16e2b440047aeec40d61afcf66459ee1d0e10c (patch) | |
tree | c1d18d2c015f353f890e0c8dc96759a39c991fce /usr.bin | |
parent | af2a1512018c2b11cec83f8d942d2e7813d564e3 (diff) | |
download | FreeBSD-src-6b16e2b440047aeec40d61afcf66459ee1d0e10c.zip FreeBSD-src-6b16e2b440047aeec40d61afcf66459ee1d0e10c.tar.gz |
A couple of miscellaneous fixes:
* prototypes for optarg/optind on platforms that don't already have them
* Disambiguate version number macros
* Remove unnecessary PACKAGE_NAME macro
* Hook for forthcoming bsdtar test suite
* Sync version number up with the portable distribution
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tar/Makefile | 7 | ||||
-rw-r--r-- | usr.bin/tar/bsdtar.c | 12 | ||||
-rw-r--r-- | usr.bin/tar/config_freebsd.h | 3 |
3 files changed, 18 insertions, 4 deletions
diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile index 153cd0e..36ac2fa 100644 --- a/usr.bin/tar/Makefile +++ b/usr.bin/tar/Makefile @@ -1,15 +1,18 @@ # $FreeBSD$ PROG= bsdtar -VERSION= 2.2.5 +BSDTAR_VERSION_STRING= 2.4.11 SRCS= bsdtar.c getdate.y matching.c read.c tree.c util.c write.c WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} LDADD= -larchive -lbz2 -lz -CFLAGS+= -DPACKAGE_VERSION=\"${VERSION}\" +CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.CURDIR} SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 +check: $(PROG) + cd ${.CURDIR}/test && make clean test + .include <bsd.prog.mk> diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index d20a5cf..a8d3c68 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -78,6 +78,14 @@ struct option { #include "bsdtar.h" +#if !HAVE_DECL_OPTARG +extern int optarg; +#endif + +#if !HAVE_DECL_OPTIND +extern int optind; +#endif + /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from * the default tape device for the system. Pick something reasonable here. @@ -784,7 +792,9 @@ usage(struct bsdtar *bsdtar) static void version(void) { - printf("bsdtar %s - %s\n", PACKAGE_VERSION, archive_version()); + printf("bsdtar %s - %s\n", + BSDTAR_VERSION_STRING, + archive_version()); exit(1); } diff --git a/usr.bin/tar/config_freebsd.h b/usr.bin/tar/config_freebsd.h index 164ce52..e24f437 100644 --- a/usr.bin/tar/config_freebsd.h +++ b/usr.bin/tar/config_freebsd.h @@ -28,7 +28,6 @@ /* A default configuration for FreeBSD, used if there is no config.h. */ #include <sys/param.h> /* __FreeBSD_version */ -#define PACKAGE_NAME "bsdtar" #if __FreeBSD__ > 4 #define HAVE_ACL_GET_PERM 0 @@ -39,6 +38,8 @@ #undef HAVE_ATTR_XATTR_H #define HAVE_BZLIB_H 1 #define HAVE_CHFLAGS 1 +#define HAVE_DECL_OPTARG 1 +#define HAVE_DECL_OPTIND 1 #define HAVE_DIRENT_D_NAMLEN 1 #define HAVE_DIRENT_H 1 #define HAVE_D_MD_ORDER 1 |