X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fbrew-run;h=26ad5380f47faf2b7634c923a1ba8194173485ae;hb=HEAD;hp=598e35306e97861f42024101de6d15789bb2c08f;hpb=e3d4dd3238c97824568b96d5f21ffacb586d4b20;p=homebrew-alex.git diff --git a/cmd/brew-run b/cmd/brew-run index 598e353..26ad538 100755 --- a/cmd/brew-run +++ b/cmd/brew-run @@ -1,5 +1,5 @@ #!/bin/sh -# 2016-08-14, alex@barton.de +# brew-run -- Update, upgrade, and clean up Hoembrew installation. # Include "ax-common.sh": ax_common_sourced= @@ -17,19 +17,21 @@ unset dir ax_common ax_common_sourced ax_msg - "Updating Homebrew installation ..." brew update || ax_abort "Update failed!" -echo -outdated=$( brew outdated --quiet | wc -l | tr -d '\t ' ) -if [ $outdated -gt 0 ]; then - ax_msg - "$outdated formula outdated:" - brew outdated || ax_abort "Failed to list outdated packages!" +outdated=$( brew outdated --verbose | grep -F -cv "pinned at" ) +if [ "$outdated" -gt 0 ]; then + echo + ax_msg - "$outdated formula & casks outdated:" + brew outdated --verbose || ax_abort "Failed to list outdated packages!" + echo + + brew upgrade --ignore-pinned || ax_abort "Upgrade failed!" echo - brew upgrade --all || ax_abort "Upgrade failed!" - brew linkapps --local || ax_abort "Linking of applications failed!" + ax_msg - "Cleaning up ..." + brew cleanup --prune=2 || ax_abort "\"brew cleanup\" failed!" echo - brew cleanup || ax_abort "\"brew cleanup\" failed!" - brew prune || ax_abort "\"brew prune\" failed!" else ax_msg 0 "Nothing outdated." + echo fi