summaryrefslogtreecommitdiff
path: root/misc/pkg_tarup
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-08-23 05:25:01 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-08-23 05:25:01 +0000
commitef76cbbf4cd07f400566a75e69d798cd28b1bbef (patch)
treeaec72b124bc337bcc3f7a74ddc2dd0abfdd94526 /misc/pkg_tarup
parentUpdate version to 1.0.6 (diff)
Make pkg_tarup invoke pkg_create(1) and pkg_info(1) with their full
paths, so it works even if /usr/sbin is not in user's PATH. Reported by: Christopher Masto <chris@netmonger.net>
Diffstat (limited to 'misc/pkg_tarup')
-rw-r--r--misc/pkg_tarup/Makefile2
-rw-r--r--misc/pkg_tarup/files/patch-aa49
2 files changed, 38 insertions, 13 deletions
diff --git a/misc/pkg_tarup/Makefile b/misc/pkg_tarup/Makefile
index 08f5cd170296..8b115ddae0f2 100644
--- a/misc/pkg_tarup/Makefile
+++ b/misc/pkg_tarup/Makefile
@@ -7,7 +7,7 @@
PORTNAME= pkg_tarup
PORTVERSION= 1.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= misc
MASTER_SITES= http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/pkgtools/pkg_tarup/files/
DISTNAME= ${PORTNAME}\?rev=${PORTVERSION}\&content-type=text%2fplain
diff --git a/misc/pkg_tarup/files/patch-aa b/misc/pkg_tarup/files/patch-aa
index 8f27fac411d6..e09be9ee8b4f 100644
--- a/misc/pkg_tarup/files/patch-aa
+++ b/misc/pkg_tarup/files/patch-aa
@@ -1,15 +1,17 @@
---- pkg_tarup.orig Sun Jun 10 12:51:53 2001
-+++ pkg_tarup Sun Jun 10 12:58:15 2001
-@@ -7,21 +7,26 @@
+--- pkg_tarup.orig Thu Aug 23 14:16:01 2001
++++ pkg_tarup Thu Aug 23 14:18:58 2001
+@@ -7,21 +7,28 @@
#
PKG_DBDIR=${PKG_DBDIR:-/var/db/pkg}
-PKGREPOSITORY=${PKGREPOSITORY:-/tmp}
PKG_SUFX=${PKG_SUFX:-tgz}
-
++PKG_INFO_CMD=/usr/sbin/pkg_info
++PKG_CREATE_CMD=/usr/sbin/pkg_create
++
+# A package file can be very big beyond /tmp's capacity
+PKGREPOSITORY=${PKGREPOSITORY:-${TMPDIR:-/var/tmp}}
-+
+
PKG="$1"
-rPKG="`pkg_info -e \"$PKG\"`"
@@ -23,7 +25,7 @@
-PKG=$rPKG
-echo "Taring up $PKG"
-+if ! pkg_info -e "$PKG"
++if ! $PKG_INFO_CMD -e "$PKG"
+then
+ echo $PKG is not installed.
+ exit 1
@@ -33,7 +35,7 @@
check_and_add() {
opt="$1"
-@@ -40,10 +45,10 @@
+@@ -40,10 +47,10 @@
check_and_add -c ${PKG_DBDIR}/${PKG}/+COMMENT
check_and_add -d ${PKG_DBDIR}/${PKG}/+DESC
@@ -47,7 +49,7 @@
check_and_add -i ${PKG_DBDIR}/${PKG}/+INSTALL
check_and_add -k ${PKG_DBDIR}/${PKG}/+DEINSTALL
check_and_add -r ${PKG_DBDIR}/${PKG}/+REQUIRE
-@@ -54,7 +59,8 @@
+@@ -54,7 +61,8 @@
sed -n \
-e '/^@comment MD5:/d' \
-e '/^@cwd \.$/,$d' \
@@ -57,14 +59,37 @@
<${PKG_DBDIR}/${PKG}/+CONTENTS >$PLIST
# Duplicate first @cwd (work around pkg_create "feature" ...)
-@@ -80,10 +86,8 @@
+@@ -64,9 +72,9 @@
+ sed \
+ -e "/`cat ${PLIST}.1 | sed 's,/,\\\\/,g'`/r${PLIST}.1" \
+ <${PLIST} >${PLIST}.2
+- mv ${PLIST}.2 ${PLIST}
++ /bin/mv ${PLIST}.2 ${PLIST}
+ fi
+-rm ${PLIST}.1
++/bin/rm ${PLIST}.1
+
+ # echo -----
+ # cat $PLIST
+@@ -76,17 +84,15 @@
+ # Just for kicks ...
+ # pkg_admin check "${PKG}"
+
+-pkg_create \
++$PKG_CREATE_CMD \
${PKG_ARGS} \
-v \
-f ${PLIST} \
- -l \
- -p "`pkg_info -qp ${PKG} | head -1 | awk '{ print $2 }'`" \
- -P "`pkg_info -qf ${PKG} | grep ^@pkgdep | awk '{ print $2 }'`" \
+- -p "`pkg_info -qp ${PKG} | head -1 | awk '{ print $2 }'`" \
+- -P "`pkg_info -qf ${PKG} | grep ^@pkgdep | awk '{ print $2 }'`" \
- -C "`pkg_info -qf ${PKG} | grep ^@pkgcfl | awk '{ print $2 }'`" \
++ -p "`$PKG_INFO_CMD -qp ${PKG} | head -1 | awk '{ print $2 }'`" \
++ -P "`$PKG_INFO_CMD -qf ${PKG} | grep ^@pkgdep | awk '{ print $2 }'`" \
${PKGREPOSITORY}/${PKG}.${PKG_SUFX}
- rm -f ${PLIST}
+-rm -f ${PLIST}
++/bin/rm -f ${PLIST}
+ exit 0
+
+