summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjoerg <joerg>2006-09-13 11:10:36 +0000
committerjoerg <joerg>2006-09-13 11:10:36 +0000
commita22e11222d70cd220b954d3dc37727dc1ac9f701 (patch)
tree55b2e6a8e4237b627362dcc9f3adcb9da15fb367 /mk
parentc3dfa6f121723f1cc3a95f405847113522aa8965 (diff)
downloadpkgsrc-a22e11222d70cd220b954d3dc37727dc1ac9f701.tar.gz
Add support for cpio archives.
Diffstat (limited to 'mk')
-rw-r--r--mk/extract/bsd.extract-vars.mk7
-rwxr-xr-xmk/extract/extract15
2 files changed, 20 insertions, 2 deletions
diff --git a/mk/extract/bsd.extract-vars.mk b/mk/extract/bsd.extract-vars.mk
index d181fb14223..5b8d1ddb7ae 100644
--- a/mk/extract/bsd.extract-vars.mk
+++ b/mk/extract/bsd.extract-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.extract-vars.mk,v 1.4 2006/08/19 20:32:28 schwarz Exp $
+# $NetBSD: bsd.extract-vars.mk,v 1.5 2006/09/13 11:10:36 joerg Exp $
#
# This Makefile fragment is included separately by bsd.pkg.mk and
# defines some variables which must be defined earlier than where
@@ -37,6 +37,11 @@ USE_TOOLS+= tar
USE_TOOLS+= pax
. endif
.endif
+.if !empty(EXTRACT_ONLY:M*.cpio) || \
+ !empty(EXTRACT_ONLY:M*.cpio.bz2) || \
+ !empty(EXTRACT_ONLY:M*.cpio.gz)
+USE_TOOLS+= pax
+.endif
.if !empty(EXTRACT_ONLY:M*.bz2) || \
!empty(EXTRACT_ONLY:M*.tbz) || \
!empty(EXTRACT_ONLY:M*.tbz2)
diff --git a/mk/extract/extract b/mk/extract/extract
index 631a4ab2595..7600d947b8c 100755
--- a/mk/extract/extract
+++ b/mk/extract/extract
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: extract,v 1.2 2006/09/03 16:36:37 schwarz Exp $
+# $NetBSD: extract,v 1.3 2006/09/13 11:10:36 joerg Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -180,6 +180,8 @@ esac
case "$distfile" in
*.tar.gz|*.tgz|*-tar.gz|*_tar.gz|*.tar.bz2|*.tbz|*.tbz2|*.tar.Z|*.tar.z|*.tar|*.tar.bz)
_format=tar ;;
+*.cpio|*.cpio.gz|*.cpio.bz2)
+ _format=cpio ;;
*.shar.gz|*.shar.bz2|*.shar.Z|*.shar|*.shr.gz|*.shr.bz2|*.shr.Z|*.shr)
_format=shar ;;
*.zip|*.ZIP) _format=zip ;;
@@ -254,6 +256,17 @@ tar)
esac
;;
+cpio)
+ : ${EXTRACT_OPTS_PAX=}
+ if ${TEST} -n "$exclude_file"; then
+ exclude=yes
+ set -- dummy `${CAT} "$exclude_file"`; shift
+ fi
+ ${TEST} "$exclude" = no || exclude_flag="-c"
+ $decompress_cat "$distfile" |
+ ${PAX} ${EXTRACT_OPTS_PAX} $exclude_flag -r ${1+"$@"}
+ ;;
+
shar)
$decompress_cat "$distfile" | ${SH}
;;