aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2007-08-27 22:48:24 +0000
committerDoug Barton <dougb@FreeBSD.org>2007-08-27 22:48:24 +0000
commitf2dbeb52f92186c807f5a56ca15b491466c819e0 (patch)
tree3b680cf18e0f768293359faf9ab8b48ef062a1ab /ports-mgmt
parent4c593af6874af9b4cf3bdd5a4f2059ba2b74a41d (diff)
downloadports-f2dbeb52f92186c807f5a56ca15b491466c819e0.tar.gz
ports-f2dbeb52f92186c807f5a56ca15b491466c819e0.zip
Notes
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/portmaster/files/portmaster.sh.in34
1 files changed, 21 insertions, 13 deletions
diff --git a/ports-mgmt/portmaster/files/portmaster.sh.in b/ports-mgmt/portmaster/files/portmaster.sh.in
index f5693d10284d..5d4d8baaade5 100644
--- a/ports-mgmt/portmaster/files/portmaster.sh.in
+++ b/ports-mgmt/portmaster/files/portmaster.sh.in
@@ -1,6 +1,6 @@
#!/bin/sh
-# Local version: 1.183
+# Local version: 1.184
# $FreeBSD$
# Copyright (c) 2005-2007 Douglas Barton, All rights reserved
@@ -217,7 +217,8 @@ safe_exit () {
fi
if [ -z "$TRAP" -a \
- -e "${TMPDIR}/f-${PARENT_PID}-package-flag" ]; then
+ -e "${TMPDIR}/f-${PARENT_PID}-package-flag" -a \
+ -n "$pkgrep" ]; then
find ${pkgrep}/ -type f -newer ${TMPDIR}/f-${PARENT_PID}-package-flag -delete
fi
@@ -850,14 +851,18 @@ delete_all_distfiles () {
fi
}
-backup_package () {
- # bu_pkg_name is used globally
+init_pkgrep () {
+ pkgrep=`make $PM_MAKE_ARGS -f/usr/share/mk/bsd.port.mk -VPKGREPOSITORY`
+ export pkgrep
+ mkdir -p $pkgrep
+}
+backup_package () {
echo "===>>> Creating a backup package for old version $1"
+ [ -n "$pkgrep" ] || fail "No package repository variable set"
+ cd $pkgrep || fail "Cannot cd into the $pkgrep directory for backup"
if pkg_create -b $1; then
- bu_pkg_name=`echo ${1}.*`
- mv $bu_pkg_name $pkgrep/ &&
- echo " ===>>> Package can be found in $pkgrep"
+ echo " ===>>> Package can be found in $pkgrep"
else
local PROCEED
@@ -1079,7 +1084,10 @@ if [ -n "$EXPUNGE" ]; then
exit 1
fi
- [ -n "$BACKUP" ] && backup_package $EXPUNGE
+ if [ -n "$BACKUP" ]; then
+ init_pkgrep
+ backup_package $EXPUNGE
+ fi
find_contents_distfiles $EXPUNGE
@@ -1125,7 +1133,10 @@ if [ -n "$CLEAN_STALE" ]; then
echo -n "===>>> ${iport} is no longer depended on, delete? [n] "
read YESNO
case "$YESNO" in
- [yY]) [ -n "$BACKUP" ] && backup_package $iport
+ [yY]) if [ -n "$BACKUP" ]; then
+ [ -z "$pkgrep" ] && init_pkgrep
+ backup_package $iport
+ fi
find_contents_distfiles $iport
@@ -1196,10 +1207,7 @@ if [ "$$" -eq "$PARENT_PID" ]; then
fi
if [ -z "$NO_BACKUP" ]; then
- pkgrep=`make $PM_MAKE_ARGS -f/usr/share/mk/bsd.port.mk -VPKGREPOSITORY`
- export pkgrep
- mkdir -p $pkgrep
-
+ init_pkgrep
if [ -z "$BACKUP" ]; then
touch ${TMPDIR}/f-${PARENT_PID}-package-flag
fi