Changeset 375 for freebsd-mgnt


Ignore:
Timestamp:
Apr 29, 2012, 2:48:42 PM (13 years ago)
Author:
Rick van der Zwet
Message:

Make the logical flow somehow more ... ehm... logical :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd-mgnt/update-via-portmaster.sh

    r374 r375  
    2525portsnap fetch update || exit 1
    2626
    27 # Find out which daemons to stop before the update
     27echo "# Find out which packages to update"
    2828update_list=`pkg_version -o -L= | xargs -n1 pkg_info -qO`
    2929
     
    3333fi
    3434
    35 # Find the rc.d/* entries affected
     35echo "# Find the rc.d/* entries affected"
    3636for pkg in $update_list; do
    3737  rc_d="$rc_d `pkg_info -qL $pkg $(pkg_info -qR $pkg) | grep -F '/rc.d/'`"
    3838done
    3939rc_d="`echo $rc_d | xargs -n1 | sort -u`"
     40
     41echo "# Going to update the following packages:"
     42echo $update_list | xargs -n1 echo "# - "
     43echo "# The following daemons will not be available:"
     44for rc in $rc_d; do
     45  echo "# - $rc (`$rc status 2>&1 | grep -v -e '^Usage:' -e 'directive' -e '^Cannot'`)"
     46done
     47echo -n "# Do you like to update the packages: (y|n) [y]: "; read INPUT
     48case $INPUT in
     49  ''|y) ;;
     50  [yY][eE][sS]) ;;
     51  *)
     52    echo "Canceled by user!"; exit 1
     53  ;;
     54esac
    4055
    4156# Stop the daemons affected
     
    4560
    4661# Install via portmaster
    47 portmaster -adG
     62portmaster --no-confirm -yadG
    4863
    4964# Just to be sure try to start all port daemons again (this will make sure the
    5065# already updated ones are also started nicely again).
    51 for rc in /usr/local/etc/rc.d/*; do
     66for rc in `rcorder /usr/local/etc/rc.d/* 2>/dev/null`; do
    5267  $rc restart
    5368done
Note: See TracChangeset for help on using the changeset viewer.