aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2008-07-28 21:24:53 +0000
committerDoug Barton <dougb@FreeBSD.org>2008-07-28 21:24:53 +0000
commit62ccec52c0f4dbd6fa88e417f06da2c4531c7768 (patch)
tree3e86bad24ad026a3380a73fc1ace408ea9ef730a /ports-mgmt
parente5ba1e5e8961f54cc37d3ff4d86aba6cfa0d07b6 (diff)
downloadports-62ccec52c0f4dbd6fa88e417f06da2c4531c7768.tar.gz
ports-62ccec52c0f4dbd6fa88e417f06da2c4531c7768.zip
New Features
============ 1. You can now specify multiple globs for directories in /var/db/pkg on the command line (along with full names of directories/paths from /usr/ports and/or /var/db/pkg, as before) 2. When calling check_interactive or update_port from check_for_updates tell the user what updated version is available. [1] Bug Fixes ========= 1. Don't set show_list to "all" for -a unless there is somthing to show 2. Add K (don't postclean) to getopts [2] Other Improvements ================== 1. In check_dependency_files() don't let ro_opd be empty for the purpose of the egrep expression. It works now, but it apparently violates the spec and could case problems down the road (e.g., for bsdgrep). 2. Since the BSDPAN pseudo-ports do not exist in the ports tree there is nothing for portmaster to do with them. Therefore ignore them when appropriate, notifying the user when necessary. [3] Submitted by: Geraint Edwards <gedge@yadn.org> [1] PR: ports/126006 [2] Submitted by: ahze [2] Pointy hat: moi [2] Problem pointed out by: Bapt <baptiste.daroussin@gmail.com> [3] PR: ports/125428 [3]
Notes
Notes: svn path=/head/; revision=217788
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/portmaster/files/portmaster.sh.in101
1 files changed, 77 insertions, 24 deletions
diff --git a/ports-mgmt/portmaster/files/portmaster.sh.in b/ports-mgmt/portmaster/files/portmaster.sh.in
index 879f00119e8d..a7a41770febf 100644
--- a/ports-mgmt/portmaster/files/portmaster.sh.in
+++ b/ports-mgmt/portmaster/files/portmaster.sh.in
@@ -42,7 +42,7 @@ umask 022
version () {
local rcs cvs
- rcs='$Id: portmaster,v 2.27 2008/03/19 21:32:24 doug Exp $'
+ rcs='$Id: portmaster,v 2.36 2008/07/28 21:13:08 doug Exp $'
cvs='$FreeBSD$'
rcs="${rcs#*,v }" ; rcs="${rcs%% *}"
@@ -177,7 +177,7 @@ safe_exit () {
;;
esac
- if [ -n "$UPDATE_ALL" ]; then
+ if [ -n "$UPDATE_ALL" -a -n "$INSTALLED_LIST" ]; then
show_list=all
else
case "$INSTALLED_LIST" in
@@ -223,9 +223,10 @@ usage () {
echo " [-x <glob pattern to exclude from building>]"
echo "${0##*/} [Common flags] <full name of port directory in $pdb>"
echo "${0##*/} [Common flags] <full path to $pd/foo/bar>"
+ echo "${0##*/} [Common flags] <glob pattern of directories in $pdb>"
echo "${0##*/} [Common flags] Multiple full names/paths from $pdb|$pd"
+ echo " and/or multiple globs from $pdb"
echo ''
- echo "${0##*/} [Common flags] <glob pattern of directories in $pdb>"
echo "${0##*/} [Common flags] -p <port directory in $pd>"
echo "${0##*/} [Common flags] . [Use in $pd/foo/bar to build that port]"
echo ''
@@ -386,8 +387,9 @@ check_dependency_files () {
# egrep hates + in file names
case "$origin" in *+*)
origin=`echo $origin | sed 's#\+#\\\\+#g'` ;; esac
- case "$ro_opd" in *+*)
- ro_opd=`echo $ro_opd | sed 's#\+#\\\\+#g'` ;; esac
+ case "$ro_opd" in
+ '') ro_opd=a/a ;;
+ *+*) ro_opd=`echo $ro_opd | sed 's#\+#\\\\+#g'` ;; esac
# Always rely on the grep'ed dependencies instead of +REQUIRED_BY
grep_deps=`pm_mktemp grep-deps-${iport}`
@@ -560,6 +562,9 @@ read_distinfos () {
for pkg in ${pdb}/*; do
[ -d $pkg ] || continue
iport=${pkg#$pdb/}
+
+ case "$iport" in bsdpan-*) continue ;; esac
+
origin=`origin_from_pdb $iport`
if [ ! -d "$pd/$origin" ]; then
@@ -623,6 +628,11 @@ IFS='
[ -d "$pkg" ] || continue
iport=${pkg#$pdb/}
+
+ case "$iport" in bsdpan-*)
+ echo "===>>> BSDPAN ports do not record dependencies ($iport)"
+ continue ;; esac
+
echo "===>>> Checking $iport"
[ -r "$pkg/+CONTENTS" ] || {
@@ -666,7 +676,7 @@ fi
#=============== End code relevant only to --features ===============
# Save switches for potential child processes
-while getopts 'BCDFGHLRabde:fghilm:nop:r:stuvwx:' COMMAND_LINE_ARGUMENT ; do
+while getopts 'BCDFGHKLRabde:fghilm:nop:r:stuvwx:' COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
B) NO_BACKUP=Bopt; ARGS="-B $ARGS" ;;
C) DONT_PRE_CLEAN=Copt; ARGS="-C $ARGS" ;;
@@ -752,7 +762,13 @@ check_for_updates () {
[ "$1" = 'list' ] && { list=list ; shift; }
- iport=$1 ; origin=${2:-`origin_from_pdb $iport`}
+ iport=$1
+
+ case "$iport" in bsdpan-*) [ -n "$PM_VERBOSE" ] &&
+ echo " ===>>> BSDPAN ports cannot be upgraded with portmaster"
+ return 0 ;; esac
+
+ origin=${2:-`origin_from_pdb $iport`}
if [ -z "$origin" ]; then
if [ -n "$PM_VERBOSE" ]; then
echo "===>>> No ORIGIN in $pdb/$iport/+CONTENTS"
@@ -847,8 +863,8 @@ check_for_updates () {
return 0
fi
- check_interactive $iport || return 0
- update_port $iport || return 1
+ check_interactive $iport $port_ver || return 0
+ update_port $iport $port_ver || return 1
return 0
}
@@ -1343,6 +1359,10 @@ check_restart_and_udf () {
check_interactive () {
[ -n "$INTERACTIVE_UPDATE" ] || return 0
+ local update_to
+
+ [ -n "$2" ] && update_to=" to $2"
+
case "$INTERACTIVE_YES" in *:${1}:*) return 0 ;; esac
case "$INTERACTIVE_NO" in *:${1}:*) return 1 ;; esac
@@ -1351,7 +1371,7 @@ check_interactive () {
echo "===>>> +IGNOREME file is present for $1"
fi
- echo '' ; echo -n "===>>> Update ${1}? [y] "
+ echo '' ; echo -n "===>>> Update ${1}${update_to}? [y] "
local answer ; read answer
case "$answer" in
[nN]*) INTERACTIVE_NO="${INTERACTIVE_NO}${1}:" ; return 1 ;;
@@ -1396,7 +1416,11 @@ check_fetch_only () {
}
update_port () {
- echo "===>>> Launching child to update ${1#$pd/}"
+ local update_to
+
+ [ -n "$2" ] && update_to=" to $2"
+
+ echo "===>>> Launching child to update ${1#$pd/}${update_to}"
[ -n "$DEPTH" ] && echo " $DEPTH >> ${1#$pd/}"
@@ -1553,28 +1577,44 @@ multiport () {
PM_MULTI_PORTS=':' ; PM_MULTI_BUILT=':'
export PM_MULTI_PORTS PM_MULTI_BUILT
- local port portlist
+ local worklist port portlist
- # Quick check of the command line arguments
+ # Expand globs and check that the directories exist
for port in $@; do
port=${port#$pdb/}
case "$port" in
- */*) [ -d "$pd/${port#$pd/}" ] ||
- fail "$pd/${port#$pd/} does not exist"
- ;;
- *) [ -d "$pdb/$port" ] ||
- fail "$pdb/$port does not exist"
- ;;
+ */*) port=${port#$pd/}
+ if [ -d "$pd/${port}" ]; then
+ worklist="$worklist $port"
+ portlist="${portlist}\t${port}\n"
+ PM_MULTI_PORTS="${PM_MULTI_PORTS}${port}:"
+ else
+ fail "$pd/${port} does not exist"
+ fi ;;
+ *) if [ -d "$pdb/$port" ]; then
+ worklist="$worklist $port"
+ portlist="${portlist}\t${port}\n"
+ PM_MULTI_PORTS="${PM_MULTI_PORTS}${port}:"
+ else
+ local globlist dir
+ globlist=`find $pdb -maxdepth 1 -type d -name ${port%\*}\*`
+ case "$globlist" in
+ *\*|'') fail "$pdb/$port does not exist" ;;
+ *) for dir in $globlist; do
+ worklist="$worklist ${dir#$pdb/}"
+ portlist="${portlist}\t${dir#$pdb/}\n"
+ PM_MULTI_PORTS="${PM_MULTI_PORTS}${dir#$pdb/}:"
+ done ;;
+ esac
+ fi ;;
esac
- portlist="${portlist}\t${port}\n"
- PM_MULTI_PORTS="${PM_MULTI_PORTS}${port}:"
done
echo "===>>> Working on multiple ports:"
echo -e $portlist
if [ -n "$CONFIG_ONLY" ]; then
- for port in $@; do
+ for port in $worklist; do
($0 $ARGS $port) || fail "Update for $port failed"
. $IPC_SAVE
done
@@ -1584,7 +1624,7 @@ multiport () {
echo "===>>> Starting build for multiple ports <<<==="
echo ''
fi
- for port in $@; do
+ for port in $worklist; do
case "$PM_MULTI_BUILT" in *:${port}:*) continue ;; esac
case "$port" in
@@ -1669,6 +1709,10 @@ all_config () {
case "$CUR_DEPS" in *:${iport}:*) continue ;; esac
+ case "$iport" in bsdpan-*) [ -n "$PM_VERBOSE" ] &&
+ echo " ===>>> BSDPAN ports cannot be upgraded with portmaster"
+ continue ;; esac
+
origin=`origin_from_pdb $iport`
case "$CONFIG_SEEN_LIST" in *:${origin}:*) continue ;; esac
@@ -1721,6 +1765,8 @@ all_config () {
case "$CUR_DEPS" in *:${iport}:*) continue ;; esac
check_exclude $iport || continue
+ case "$iport" in bsdpan-*) continue ;; esac
+
DEPTH=
if [ -n "$PM_FORCE" ]; then
udf="$pdb/$iport/PM_UPGRADE_DONE_FLAG"
@@ -1805,7 +1851,14 @@ fi
if [ -n "$upg_port" -a -z "$REPLACE_ORIGIN" ]; then
portdir=`origin_from_pdb $upg_port`
- [ -n "$portdir" ] || fail "No ORIGIN in $pdb/$upg_port/+CONTENTS"
+ if [ ! -n "$portdir" ]; then
+ case "$upg_port" in
+ bsdpan-*) echo ''
+ echo "===>>> BSDPAN ports cannot be upgraded with portmaster"
+ echo " (${upg_port})"; echo ''; safe_exit ;;
+ *) fail "No ORIGIN in $pdb/$upg_port/+CONTENTS" ;;
+ esac
+ fi
elif [ -z "$portdir" ]; then
no_valid_port
fi