Fix EXTRACT_CASES for shell archives (handles leading cruft, too!)

ok espie@
This commit is contained in:
jsyn 2001-07-30 14:45:26 +00:00
parent ad09219591
commit 62cee9e1e2

View File

@ -1,6 +1,6 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.429 2001/07/30 14:34:34 espie Exp $$
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.430 2001/07/30 14:45:26 jsyn Exp $$
# $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $
# $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
#
@ -948,6 +948,8 @@ USE_BZIP2?= No
EXTRACT_CASES?=
_SED_FIX_SHAR?= sed -e '1,/^\#\![[:blank:]]*\/bin\/sh[[:space:]]*$/d'
# XXX note that we DON'T set EXTRACT_SUFX.
.if ${USE_ZIP:L} != "no"
BUILD_DEPENDS+= ${UNZIP}::archivers/unzip
@ -958,8 +960,8 @@ BUILD_DEPENDS+= ${BZIP2}::archivers/bzip2
EXTRACT_CASES+= *.tar.bz2) ${BZIP2} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
.endif
EXTRACT_CASES+= *.tar) ${TAR} xf ${FULLDISTDIR}/$$archive;;
EXTRACT_CASES+= *.shar.gz|*.shar.Z|*.sh.Z|*.sh.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | /bin/sh;;
EXTRACT_CASES+= *.shar | *.sh) /bin/sh ${FULLDISTDIR}/$$archive;;
EXTRACT_CASES+= *.shar.gz|*.shar.Z|*.sh.gz|*.sh.Z) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${_SED_FIX_SHAR} | /bin/sh;;
EXTRACT_CASES+= *.shar | *.sh) ${_SED_FIX_SHAR} ${FULLDISTDIR}/$$archive | /bin/sh;;
EXTRACT_CASES+= *.tar.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
EXTRACT_CASES+= *.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive >`basename $$archive .gz`;;
EXTRACT_CASES+= *) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;