Fix checkupdates()
[pkgusr] / etc / pkgusr / handy_funcs
index 2158024..b07068d 100644 (file)
@@ -112,70 +112,6 @@ gpkg()
     sed -n ${top},${bot}p ${HOME}/.project|less
 }
 
-xtar()
-{
-    local opts
-    local type
-    local fname=$1
-
-    if [ -z "${fname}" ]; then
-       echo No filename specified >&2
-       return 1
-    fi
-
-    type=$(file ${fname}|cut -d' ' -f2)
-
-    case $type in
-       (tar)    opts=xf ;;
-       (gzip)   opts=zxf ;;
-       (bzip2)  opts=jxf ;;
-       (xz|XZ)  opts=Jxf ;;
-       (*)
-       # try lzma
-       if lzmainfo ${fname} &>/dev/null; then
-           opts="--lzma -xf"
-       else
-           printf "Unknown file type: %s\n" $type >&2
-           return 2
-       fi
-       ;;
-    esac
-
-    tar ${opts} ${fname}
-}
-
-vtar()
-{
-    local opts
-    local type
-    local fname=$1
-
-    if [ -z "${fname}" ]; then
-       echo No filename specified >&2
-       return 1
-    fi
-
-    type=$(file ${fname}|cut -d' ' -f2)
-
-    case $type in
-       (tar)    opts=tvvvf ;;
-       (gzip)   opts=ztvvvf ;;
-       (bzip2)  opts=jtvvvf ;;
-       (xz|XZ)  opts=Jtvvvf ;;
-       (*)
-        # lzma.  Here because lzmainfo is too stupid
-       if lzmainfo ${fname} &>/dev/null; then
-           opts="--lzma -tvvvf"
-       else
-           printf "Unknown file type: %s\n" $type >&2
-           return 2
-       fi
-       ;;
-    esac
-
-    tar ${opts} ${fname}|less
-}
-
 ## Check if there is a newer build script, maybe update.
 #  NOTE: Updating needs SXEmacs.  It'll work in XEmacs and Emacs too,
 #  but you'll need to change build-update() accordingly.
@@ -198,7 +134,7 @@ checkupdates()
     local sysbv=$(${sysb} -V|awk '/build:/ {print $2;}')
     local pkgbv=$(${pkgb} -V|awk '/build:/ {print $2;}')
     
-    if [ ${sysb} -nt ${pkgb} ]; then
+    if [[ ${sysbv} > ${pkgbv} ]]; then
        echo '*****************************************'
        echo '*                                       *'
        echo '*  B u i l d  S c r i p t  U p d a t e  *'
@@ -248,6 +184,8 @@ alias ebp='vi -a ${HOME}/{build,.project}'
 alias deps='grep --colour "Deps: " ${HOME}/.project'
 alias listp='pinky -l $(whoami)|less'
 alias patches='find ${SLACKPKG}/**/$(whoami)|grep -E "(diff|patch)"'
+alias vtar=less
+alias xtar='tar xf'
 
 H-pkg()
 {
@@ -279,22 +217,20 @@ Logs:
 
 Package Notes/Content:
 
-        ipkg            Displays the \`Install Notes'. (alias: ipkg)
-        gpkg            Displays the \`General Notes'. (alias: gpkg)
+        ipkg            Displays the \`Install Notes'.
+        gpkg            Displays the \`General Notes'.
         listp           Displays the entire package info (piped through less(1))
         srepo           Display the package's source repo location.
        rawrepo         Output just the repo URL (to use with lynx, curl, etc)
-        trepo           Display the type of repo (tla, git, svn, mercurial etc)
+        trepo           Display the type of repo (git, svn, mercurial, tla etc)
         web             Display the package's homepage URL.
        rawweb          Output just the web URL (to use with lynx etc)
         deps            Display the package's dependencies
 
 Tarball Handling:
 
-        xtar [TARBALL]  Extract TARBALL, automatically choosing the appropriate
-                        tar(1) options.
-        vtar [TARBALL]  List the contents of TARBALL, automatically choosing 
-                        appropriate options and piping through less(1).
+        xtar [TARBALL]  Extract TARBALL
+        vtar [TARBALL]  List the contents of TARBALL
 
 Build Scripts: