# HG changeset patch # User Christophe Lincoln # Date 1337906496 -7200 # Node ID b84e0d36c9e0a5d174d9c852c0bdbb2512eca4eb # Parent 75dbce631b427166b93580f7d4932972efe27b0b spk-ls: warm if missing receipt diff -r 75dbce631b42 -r b84e0d36c9e0 spk-ls --- a/spk-ls Thu May 24 22:12:53 2012 +0200 +++ b/spk-ls Fri May 25 02:41:36 2012 +0200 @@ -40,6 +40,18 @@ exit 0 } +# Source a package receipt +source_receipt() { + local receipt=$1 + if [ ! -f $receipt ]; then + echo -n $(colorize 31 "$pkg") + indent 28 $(gettext "missing receipt") + continue + else + . $receipt + fi +} + # # Handle --options # @@ -87,12 +99,13 @@ exit 0 ;; --short) newline - boldify $(gettext "Installed packages") + echo -n $(boldify $(gettext "Package")) + indent 28 $(boldify $(gettext "Version")) separator for pkg in $(ls -1 $installed) do - . $installed/$pkg/receipt - echo -n "$(colorize 32 $pkg)"; indent 28 " $VERSION" + source_receipt $installed/$pkg/receipt + echo -n "$(colorize 32 $pkg)"; indent 28 "$VERSION" done separator boldify $(count_installed)