Skip site navigation (1)Skip section navigation (2)
Date:      1 Feb 1999 19:22:31 +0900
From:      sada@rr.iij4u.or.jp (SADA Kenji)
To:        kkennawa@physics.adelaide.edu.au
Cc:        ports@FreeBSD.ORG
Subject:   Re: USE_BZIP2
Message-ID:  <19990201102231.10200.sada@rr.iij4u.or.jp>
In-Reply-To: Your message of "Sun, 31 Jan 1999 16:00:45 JST". <Pine.OSF.4.05.9901311726260.22249-100000@bragg>

next in thread | previous in thread | raw e-mail | index | archive | help
>> Can we have a USE_BZIP2 variable added to the build process, or perhaps
>> automatic sensing of the .tar.bz2 EXTRACT_SUFX, to avoid the need to do things
>> like:
:
>> This will become more useful as more ports start using bzip2'ed distfiles.

I agree.  For example, `automatic sensing' would be realized as below,
but I can't imagine how to auto-depend to ${PORTSDIR}/archivers/bzip2.

--- bsd.port.mk.orig	Mon Feb  1 16:38:32 1999
+++ bsd.port.mk	Mon Feb  1 19:19:44 1999
@@ -672,6 +672,10 @@
 EXTRACT_BEFORE_ARGS?=   -xzf
 .endif
 
+BZIP2_EXTRACT_CMD=	bzip2
+BZIP2_EXTRACT_BEFORE_ARGS=	-dc
+BZIP2_EXTRACT_AFTER_ARGS=	| /usr/bin/tar -xf -
+
 # Figure out where the local mtree file is
 .if !defined(MTREE_FILE)
 .if defined(USE_X_PREFIX)
@@ -1333,9 +1337,11 @@
 	@${RM} -rf ${WRKDIR}
 	@${MKDIR} ${WRKDIR}
 	@for file in ${EXTRACT_ONLY}; do \
-		if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
-		then \
-			exit 1; \
+		cd ${WRKDIR}; \
+		if [ `expr $$file : '.*\.tar\.bz2'` -gt 0 ]; then \
+			${BZIP2_EXTRACT_CMD} ${BZIP2_EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${BZIP2_EXTRACT_AFTER_ARGS} || exit 1; \
+		else \
+			${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS} || exit 1; \
 		fi \
 	done
 .endif

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990201102231.10200.sada>