Changes between Version 6 and Version 7 of Scripts/testport_script


Ignore:
Timestamp:
Apr 24, 2012, 10:40:27 AM (13 years ago)
Author:
kato23@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/testport_script

    v6 v7  
    191191if [[ $# -eq 0 ]]; then
    192192  if [[ $clean_all -eq 1 ]]; then
    193       ( port -f clean --all installed 2>/dev/null ) || true
     193      [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
    194194      exit
    195195   elif [[ $update -eq 1 ]]; then
    196       port -f clean --all installed
     196      [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
    197197      port selfupdate
    198198      port outdated
    199       ( port upgrade -R -u outdated 2>/dev/null ) || true
     199      [[ $(port outdated | wc -l) -gt 1 ]] && port upgrade -R -u outdated
    200200      exit
    201201   else
     
    251251if [[ -x "${MP_PREFIX}/bin/port" ]]; then
    252252   if [[ $clean_all -eq 1 ]]; then
    253       ( port -f clean --all installed 2>/dev/null ) || true
     253      [[ $(port installed | wc -l) -gt 1 ]] && port -f clean --all installed
    254254   else
    255       ( port -f clean --work "$@" 2>/dev/null ) || true
     255      [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f clean --work "$@"
    256256   fi
    257257fi
     
    261261
    262262   if [[ -x "${MP_PREFIX}/bin/port" ]]; then
    263       ( port -f uninstall installed 2>/dev/null ) || true
     263      [[ $(port installed | wc -l) -gt 1 ]] && port -f uninstall installed
    264264   fi
    265265
     
    301301   port selfupdate
    302302   port outdated
    303    ( port upgrade -R -u outdated 2>/dev/null ) || true
     303   [[ $(port outdated | wc -l) -gt 1 ]] && port upgrade -R -u outdated
    304304fi
    305305
    306306
    307307if [[ $remove -eq 1 ]]; then
    308    port -f clean --all "$@"
    309    port -f -v uninstall "$@"
     308   [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f clean --all "$@"
     309   [[ $(port installed "$@" | wc -l) -gt 1 ]] && port -f -v uninstall "$@"
    310310fi
    311311