summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_tarup/files
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2003-05-28 14:53:42 +0000
committerhubertf <hubertf@pkgsrc.org>2003-05-28 14:53:42 +0000
commit16b9a3f0295036a96e344b5cd6a10a40ac8978e2 (patch)
tree5053ef99ab96fe8e3cc171dd07732124cebceaee /pkgtools/pkg_tarup/files
parentf0415778fb031c728b373a3086c30cfe600b30f5 (diff)
downloadpkgsrc-16b9a3f0295036a96e344b5cd6a10a40ac8978e2.tar.gz
Update pkg_tarup to 1.4. Changes:
- Add pkg_tarup_all to tarup a pkg plus all it's dependencies.
Diffstat (limited to 'pkgtools/pkg_tarup/files')
-rw-r--r--pkgtools/pkg_tarup/files/pkg_tarup_all35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgtools/pkg_tarup/files/pkg_tarup_all b/pkgtools/pkg_tarup/files/pkg_tarup_all
new file mode 100644
index 00000000000..d44ef3e572d
--- /dev/null
+++ b/pkgtools/pkg_tarup/files/pkg_tarup_all
@@ -0,0 +1,35 @@
+#! @SH@
+#
+# $Id: pkg_tarup_all,v 1.1 2003/05/28 14:53:43 hubertf Exp $
+#
+# Tar up installed package plus dependencies
+#
+# (c) Copyright 2003 Hubert Feyrer <hubert@feyrer.de>
+#
+
+PREFIX=${PREFIX:-@PREFIX@}
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:@PKG_TOOLS_BIN@
+export PATH
+
+AWK=${AWK:-@AWK@}
+ECHO=${ECHO:-@ECHO@}
+HEAD=${HEAD:-@HEAD@}
+ID=${ID:-@ID@}
+SU=${SU:-@SU@}
+PKG_INFO=${PKG_INFO:-@PKG_INFO@}
+
+if [ `${ID} -u` != 0 ]; then
+ ${ECHO} "Becoming root@`/bin/hostname` to create binary packages"
+ ${ECHO} -n "`${ECHO} ${SU} | ${AWK} '{ print $$1 }'` ";\
+ exec ${SU} root -c "$0 $@"
+fi
+
+# 1. dependencies
+pkg_info -qf "$1" \
+| grep @pkgdep \
+| ${AWK} '{print $2}' \
+| xargs -n 1 ${PREFIX}/bin/pkg_tarup
+
+# 2. the pkg itself
+${PREFIX}/bin/pkg_tarup "$1"