freebsd-update.sh (215087) | freebsd-update.sh (217767) |
---|---|
1#!/bin/sh 2 3#- 4# Copyright 2004-2007 Colin Percival 5# All rights reserved 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted providing that the following conditions --- 11 unchanged lines hidden (view full) --- 20# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 25# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26# POSSIBILITY OF SUCH DAMAGE. 27 | 1#!/bin/sh 2 3#- 4# Copyright 2004-2007 Colin Percival 5# All rights reserved 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted providing that the following conditions --- 11 unchanged lines hidden (view full) --- 20# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 24# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 25# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26# POSSIBILITY OF SUCH DAMAGE. 27 |
28# $FreeBSD: head/usr.sbin/freebsd-update/freebsd-update.sh 215087 2010-11-10 14:33:09Z bcr $ | 28# $FreeBSD: head/usr.sbin/freebsd-update/freebsd-update.sh 217767 2011-01-24 04:32:59Z gordon $ |
29 30#### Usage function -- called from command-line handling code. 31 32# Usage instructions. Options not listed: 33# --debug -- don't filter output from utilities 34# --no-stats -- don't show progress statistics while fetching files 35usage () { 36 cat <<EOF --- 1833 unchanged lines hidden (view full) --- 1870 # Report to the user if any updates were avoided due to local changes 1871 if [ -s modifiedfiles ]; then 1872 echo 1873 echo -n "The following files are affected by updates, " 1874 echo "but no changes have" 1875 echo -n "been downloaded because the files have been " 1876 echo "modified locally:" 1877 cat modifiedfiles | 29 30#### Usage function -- called from command-line handling code. 31 32# Usage instructions. Options not listed: 33# --debug -- don't filter output from utilities 34# --no-stats -- don't show progress statistics while fetching files 35usage () { 36 cat <<EOF --- 1833 unchanged lines hidden (view full) --- 1870 # Report to the user if any updates were avoided due to local changes 1871 if [ -s modifiedfiles ]; then 1872 echo 1873 echo -n "The following files are affected by updates, " 1874 echo "but no changes have" 1875 echo -n "been downloaded because the files have been " 1876 echo "modified locally:" 1877 cat modifiedfiles |
1878 fi | more | 1878 fi | $PAGER |
1879 rm modifiedfiles 1880 1881 # If no files will be updated, tell the user and exit 1882 if ! [ -s INDEX-PRESENT ] && 1883 ! [ -s INDEX-NEW ]; then 1884 rm INDEX-PRESENT INDEX-NEW 1885 echo 1886 echo -n "No updates needed to update system to " --- 13 unchanged lines hidden (view full) --- 1900 rm INDEX-PRESENT.flist INDEX-NEW.flist 1901 1902 # Report removed files, if any 1903 if [ -s files.removed ]; then 1904 echo 1905 echo -n "The following files will be removed " 1906 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1907 cat files.removed | 1879 rm modifiedfiles 1880 1881 # If no files will be updated, tell the user and exit 1882 if ! [ -s INDEX-PRESENT ] && 1883 ! [ -s INDEX-NEW ]; then 1884 rm INDEX-PRESENT INDEX-NEW 1885 echo 1886 echo -n "No updates needed to update system to " --- 13 unchanged lines hidden (view full) --- 1900 rm INDEX-PRESENT.flist INDEX-NEW.flist 1901 1902 # Report removed files, if any 1903 if [ -s files.removed ]; then 1904 echo 1905 echo -n "The following files will be removed " 1906 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1907 cat files.removed |
1908 fi | more | 1908 fi | $PAGER |
1909 rm files.removed 1910 1911 # Report added files, if any 1912 if [ -s files.added ]; then 1913 echo 1914 echo -n "The following files will be added " 1915 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1916 cat files.added | 1909 rm files.removed 1910 1911 # Report added files, if any 1912 if [ -s files.added ]; then 1913 echo 1914 echo -n "The following files will be added " 1915 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1916 cat files.added |
1917 fi | more | 1917 fi | $PAGER |
1918 rm files.added 1919 1920 # Report updated files, if any 1921 if [ -s files.updated ]; then 1922 echo 1923 echo -n "The following files will be updated " 1924 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1925 1926 cat files.updated | 1918 rm files.added 1919 1920 # Report updated files, if any 1921 if [ -s files.updated ]; then 1922 echo 1923 echo -n "The following files will be updated " 1924 echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" 1925 1926 cat files.updated |
1927 fi | more | 1927 fi | $PAGER |
1928 rm files.updated 1929 1930 # Create a directory for the install manifest. 1931 MDIR=`mktemp -d install.XXXXXX` || return 1 1932 1933 # Populate it 1934 mv INDEX-PRESENT ${MDIR}/INDEX-OLD 1935 mv INDEX-NEW ${MDIR}/INDEX-NEW --- 1261 unchanged lines hidden (view full) --- 3197 IDS_run || exit 1 3198} 3199 3200#### Entry point 3201 3202# Make sure we find utilities from the base system 3203export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} 3204 | 1928 rm files.updated 1929 1930 # Create a directory for the install manifest. 1931 MDIR=`mktemp -d install.XXXXXX` || return 1 1932 1933 # Populate it 1934 mv INDEX-PRESENT ${MDIR}/INDEX-OLD 1935 mv INDEX-NEW ${MDIR}/INDEX-NEW --- 1261 unchanged lines hidden (view full) --- 3197 IDS_run || exit 1 3198} 3199 3200#### Entry point 3201 3202# Make sure we find utilities from the base system 3203export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} 3204 |
3205# Set a pager if the user doesn't 3206if [ -z "$PAGER" ]; then 3207 PAGER=/usr/bin/more 3208fi 3209 |
|
3205# Set LC_ALL in order to avoid problems with character ranges like [A-Z]. 3206export LC_ALL=C 3207 3208get_params $@ 3209for COMMAND in ${COMMANDS}; do 3210 cmd_${COMMAND} 3211done | 3210# Set LC_ALL in order to avoid problems with character ranges like [A-Z]. 3211export LC_ALL=C 3212 3213get_params $@ 3214for COMMAND in ${COMMANDS}; do 3215 cmd_${COMMAND} 3216done |