Diff from pkgfe-20060203.tar.gz to pkgfe-20060207.tar.gz

 

--- pkgfe-20060203/pkgfe Fri Feb 3 11:08:37 2006 +++ pkgfe-20060207/pkgfe Tue Feb 7 03:40:48 2006
@@ -14,6 +14,11 @@ PKGDB_PATH=${PKG_DBDIR:-/var/db/pkg} + # Miscellaneous + + PAGER_PROGRAM=${PAGER:-less} + + ############################################################################### _prog()
@@ -21,9 +26,12 @@ basename $0 } - _date() + _plural() { - date '+%Y-%m-%d %H:%M:%S' + if [ $1 -ne 1 ] + then + echo 's' + fi }
@@ -42,7 +50,7 @@ $P cvs Update ports tree using Csup Run make fetchindex in $PORTS_PATH Run portsdb -u - Run $P listup + Run $P list $P all Run $P cvs Run $P
@@ -89,7 +97,7 @@ } - do_listup() + do_list() { local NUM PORTVERSION_COMMAND
@@ -98,7 +106,9 @@ echo echo "> $PORTVERSION_COMMAND" - $PORTVERSION_COMMAND > "$STATUSFILE" || exit 1 + $PORTVERSION_COMMAND | \ + sed 's/<//; s/needs updating (port has //; s/) *$//' > \ + "$STATUSFILE" || exit 1 echo
@@ -106,12 +116,11 @@ NUM=`wc -l "$STATUSFILE" | awk '{print $1}'` echo '-----------------------------------' - echo "Found $NUM outdated package(s)" + echo "Found $NUM outdated package`_plural $NUM`" echo '-----------------------------------' if [ "$NUM" -eq 0 -a "$1" = exit-if-none ] then - echo 'Exiting...' exit 0 fi
@@ -157,7 +166,7 @@ echo - do_listup + do_list } do_fixdb()
@@ -183,6 +192,13 @@ TYPE=name STR="$1" + + if [ ! "$STR" ] + then + error "error: empty search string" + fi + + case "$1" in name|key)
@@ -196,7 +212,7 @@ echo "> cd $PORTS_PATH && make search $TYPE=$STR" cd $PORTS_PATH && \ - ( make search "$TYPE"="$STR" | less ) + ( make search "$TYPE"="$STR" | $PAGER_PROGRAM ) exit 0 }
@@ -228,13 +244,17 @@ do if [ ! "$name" = pkgdb.db -a ! -f "$name/+REQUIRED_BY" ] then - DIALOG_PKGLIST="$DIALOG_PKGLIST '$name' 'no +REQUIRED_BY' OFF" + DIALOG_OPTIONS="$DIALOG_OPTIONS '$name' 'no +REQUIRED_BY' OFF" NUM=$(($NUM + 1)) fi done - eval "dialog --title '`_prog` - chkreq - `_date`' --checklist '\n$NUM not required package(s):\n' -1 -1 $DIALOG_LIST_HEIGHT $DIALOG_PKGLIST 2> '$tmpfile'" + eval "dialog --title '`_prog`: chkreq' \ + --checklist '\n$NUM not required package`_plural $NUM`\n' \ + -1 -1 $DIALOG_LIST_HEIGHT \ + $DIALOG_OPTIONS \ + 2> '$tmpfile'" PACKAGES=`cat "$tmpfile"`
@@ -271,7 +291,8 @@ do_checkbinaries() { - for binary in portupgrade portversion dialog csup portsdb pkgdb portaudit + for binary in portupgrade portversion dialog \ + csup portsdb pkgdb portaudit $PAGER_PROGRAM do which "$binary" > /dev/null
@@ -377,7 +398,7 @@ case "$1" in listup|list) - do_listup + do_list exit 0 ;; cvsup|cvs|csup)
@@ -404,7 +425,7 @@ do_csup ;; listup+run|list+run) - do_listup + do_list ;; chkbin) do_checkbinaries
@@ -419,71 +440,65 @@ if [ ! -s "$STATUSFILE" ] then - do_listup exit-if-none + do_list exit-if-none fi - TMPLISTFILE=`make_tmp` TMPOPTIONSFILE=`make_tmp` - case "$WITH_HELD_PKGS" - in - [Yy][Ee][Ss]) - sed 's/<//' < "$STATUSFILE" > "$TMPLISTFILE" - ;; - *) - sed 's/<//' < "$STATUSFILE" | grep -v '\[held\]' > "$TMPLISTFILE" - ;; - esac - - NUM=0 while read name comments do - DIALOG_OPTIONS="$DIALOG_OPTIONS '$name' '$comments' OFF" + DIALOG_OPTIONS="$DIALOG_OPTIONS '$name' '< $comments' OFF" NUM=$(($NUM + 1)) done < \ - "$TMPLISTFILE" + "$STATUSFILE" - rm -f "$TMPLISTFILE" - if [ ! "$DIALOG_OPTIONS" ] then error 'Error: $DIALOG_OPTIONS is empty' fi - eval "dialog --title '`_prog` - `_date`' --checklist '\n$NUM outdated package(s):\n' -1 -1 $DIALOG_LIST_HEIGHT $DIALOG_OPTIONS 2> '$TMPOPTIONSFILE'" + eval "dialog --title '`_prog`: list' \ + --checklist '\nFound $NUM outdated package`_plural $NUM`\n' \ + -1 -1 $DIALOG_LIST_HEIGHT \ + $DIALOG_OPTIONS \ + 2> '$TMPOPTIONSFILE'" - PACKAGES=`cat "$TMPOPTIONSFILE" | sed 's/"//g'` + PACKAGES=`sed 's/"//g' < "$TMPOPTIONSFILE"` rm -f "$TMPOPTIONSFILE" if [ "$PACKAGES" ] then - echo - echo 'Upgrading packages:' - NUM=0 + for package in $PACKAGES do - echo "- $package" + UPGRADE_DIALOG="$UPGRADE_DIALOG '$package' ' '" + NUM=$(($NUM + 1)) done - echo - read -p "Upgrade $NUM package(s) [Y/n]? " -r CONFIRM + eval "dialog --title '`_prog`: upgrade' \ + --menu '\nUpgrade $NUM package`_plural $NUM`?\n' \ + -1 -1 $DIALOG_LIST_HEIGHT \ + $UPGRADE_DIALOG \ + 2> /dev/null" - case "$CONFIRM" + + case $? in - [Yy]) + 0) + echo do_padb
@@ -500,7 +515,8 @@ case "$LISTUP_AFTER_UPGRADE" in [Yy][Ee][Ss]) - do_listup + echo + do_list ;; esac fi
@@ -509,7 +525,7 @@ ;; *) echo - echo 'None of packages upgraded' + echo 'Upgrade cancelled' echo exit 0
@@ -518,7 +534,7 @@ else echo - echo 'Nothing to upgrade. exiting...' + echo 'No packages selected' echo exit 0

 

--- pkgfe-20060203/pkgfe.conf Fri Feb 3 11:08:37 2006 +++ pkgfe-20060207/pkgfe.conf Tue Feb 7 03:40:48 2006
@@ -15,7 +15,5 @@ LISTUP_AFTER_UPGRADE=yes - WITH_HELD_PKGS=no - DIALOG_LIST_HEIGHT=10