# HG changeset patch # User Christophe Lincoln # Date 1337876362 -7200 # Node ID ee3163f781b31899b82ef3704de38341ebbf122e # Parent 6963573f72422a64e7cc7ff9aa06e057650bab94 spk-up: get repo name earlier and to it better for individual packages up diff -r 6963573f7242 -r ee3163f781b3 spk-up --- a/spk-up Thu May 24 17:02:36 2012 +0200 +++ b/spk-up Thu May 24 18:19:22 2012 +0200 @@ -112,17 +112,6 @@ echo -n "$PACKAGE" echo -n $(indent 28 "$VERSION") - # Mirror name - case $repo in - $PKGS_DB) reponame=$(gettext "Official") ;; - *) reponame=$(gettext "Extra") ;; - esac - # Local have priority - if [ -d "$localdb" ] && $(grep -q "^$PACKAGE |" $extradb/local/packages.desc); then - #local_count=$(($local_count + 1)) - reponame=$(gettext "Local") - fi - # Blocked if $(grep -qs "^$PACKAGE" $blocked); then blocked_count=$(($blocked_count + 1)) @@ -147,18 +136,30 @@ check_pkgup() { unset_receipt . $pkg/receipt + localdb=$extradb/local sum=$(fgrep " $PACKAGE-${VERSION}$EXTRAVERSION.tazpkg" \ $installed.$SUM | awk '{print $1}') # Skip up-to-date local packages if [ -d "$extradb/local" ] && fgrep -q "$sum $PACKAGE-" $extradb/local/packages.$SUM; then - continue + reponame=$(gettext "Local") + return 0 fi for repo in $(priority); do dbdesc=$repo/packages.desc dbsum=$repo/packages.$SUM + # Mirror name + case $repo in + $PKGS_DB) reponame=$(gettext "Official") ;; + *) reponame=$(gettext "Extra") ;; + esac + # Overwrite: Local have priority + if [ -d "$extradb/local" ] && $(grep -q "^$PACKAGE |" $extradb/local/packages.desc); then + reponame=$(gettext "Local") + fi + # Sum match or not ? if ! fgrep -q "$sum $PACKAGE-" $dbsum; then up_type @@ -195,18 +196,17 @@ if [ -f "$installed/$pkg/receipt" ]; then count=$(($count +1)) cd $installed + . $pkg/receipt check=$(check_pkgup) if [ "$check" != "" ]; then echo "$check" [ "$add" ] && install_up else - if $(grep -qs "^${pkg}$" $blocked); then - echo -n $(colorize 31 "$pkg $VERSION ") - gettext "is blocked"; newline - else - echo -n $(boldify "$pkg $VERSION ") - gettext "is up-to-date. Version"; newline - fi + echo -n "$pkg" + echo -n $(indent 28 "$VERSION") + echo -n $(colorize 32 $(indent 48 $(gettext "up-to-date"))) + check_pkgup + indent 68 "$reponame" fi fi ;; esac