#!/bin/bash
#
# pt -- the MacPorts port tool"
-# Copyright (c)2007,2008 Alexander Barton, alex@barton.de
+# Copyright (c)2007-2009 Alexander Barton, alex@barton.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
NAME=`basename "$0"`
-VERSION="0.0.9"
-DATE="2007-11-15"
+VERSION="0.2.1"
+DATE="2009-07-06"
QUIET=
PORT_VERBOSE=
UPGRADE_REMOVE_INACTIVE=1
CLEAN_WORKDIR=1
+TMPDIR=
+
declare -i WIDTH=${COLUMNS:-80}
LINE="-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
# Display version information.
echo "$NAME $VERSION ($DATE) -- the MacPorts port tool"
- echo "Copyright (c)2007 Alexander Barton, alex@barton.de"
+ echo "Copyright (c)2007-2009 Alexander Barton, alex@barton.de"
echo
echo "This is free software; see the source for copying conditions. There is NO"
echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
echo " remove <port> [<port> [...]] -- remove port(s)"
echo " clean <port> [<port> [...]] -- clean port build files"
echo " update -- update port database"
+ echo " outdated -- list all outdated ports"
echo " upgrade -- upgrade outdated port(s)"
echo " freshup -- update port database & list outdated ports"
echo " search <term> -- search for port(s)"
[ "$1" = "" ] \
&& Msg -n "Ports base version: " \
|| Msg -n "$1: "
- version=$( port --version </dev/null | grep "MacPorts" )
+ version=$( port --version 2>/dev/null | grep "MacPorts" )
+ [ $? -eq 0 ] || version=$( port version | cut -d' ' -f2 )
Msg "$version"
QUIET=$q
return $r
Upgrade
Clean_Exit $?
;;
- "freshup"|"fresh"|"up")
+ "freshup"|"fresh")
shift
Check_Root_Perm
[ $# -ne 0 ] && Usage
List_Outdated
Clean_Exit $?
;;
+ "go"|"up")
+ shift
+ Check_Root_Perm
+ [ $# -ne 0 ] && Usage
+ Update
+ Upgrade
+ Clean_Exit $?
+ ;;
"remove"|"uninstall")
shift
Check_Root_Perm