]> arthur.barton.de Git - pt.git/blobdiff - bin/pt
Update copyright year to "2007-2009".
[pt.git] / bin / pt
diff --git a/bin/pt b/bin/pt
index 5ab4cb0faf17e126260e2030a4e15183ce04399c..303069dbb05240e0af2bac2e93d945efc3c8f9cb 100755 (executable)
--- a/bin/pt
+++ b/bin/pt
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # pt -- the MacPorts port tool"
-# Copyright (c)2007 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
@@ -9,12 +9,10 @@
 # (at your option) any later version.
 # Please read the file COPYING, README and AUTHORS for more information.
 #
-# $Id$
-#
 
 NAME=`basename "$0"`
-VERSION="0.0.9"
-DATE="2007-11-15"
+VERSION="0.2.0"
+DATE="2008-12-14"
 
 QUIET=
 PORT_VERBOSE=
@@ -32,7 +30,7 @@ Version() {
        # 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."
@@ -51,7 +49,9 @@ Usage() {
        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)"
        echo "  list <term>                    -- list port(s)"
        echo "  info <port>                    -- display details of a port"
@@ -787,7 +787,8 @@ Status() {
        [ "$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
@@ -916,6 +917,22 @@ case "$1" in
                Upgrade
                Clean_Exit $?
                ;;
+       "freshup"|"fresh")
+               shift
+               Check_Root_Perm
+               [ $# -ne 0 ] && Usage
+               Update
+               List_Outdated
+               Clean_Exit $?
+               ;;
+       "go"|"up")
+               shift
+               Check_Root_Perm
+               [ $# -ne 0 ] && Usage
+               Update
+               Upgrade
+               Clean_Exit $?
+               ;;
        "remove"|"uninstall")
                shift
                Check_Root_Perm