Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147969637
D39761.1784963039.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D39761.1784963039.diff
View Options
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -632,7 +632,6 @@
QUIETREDIR="/dev/stderr"
QUIETFLAG=" "
STATSREDIR="/dev/stderr"
- DDSTATS=".."
XARGST="-t"
NDEBUG=" "
;;
@@ -640,7 +639,6 @@
QUIETREDIR=""
QUIETFLAG=""
STATSREDIR="/dev/null"
- DDSTATS=".."
XARGST=""
NDEBUG=""
;;
@@ -648,7 +646,6 @@
QUIETREDIR="/dev/null"
QUIETFLAG="-q"
STATSREDIR="/dev/stdout"
- DDSTATS=""
XARGST=""
NDEBUG="-n"
;;
@@ -1186,16 +1183,26 @@
# Print user-friendly progress statistics
fetch_progress () {
- LNC=0
+ # Prompt
+ local FPMPT="$1"
+ # Total count
+ local FCNT=$2
+ # Local variables
+ local LNC=0
+ local _pstr=""
+ printf "%s... " "${FPMPT}"
while read x; do
- LNC=$(($LNC + 1))
- if [ $(($LNC % 10)) = 0 ]; then
- echo -n $LNC
- elif [ $(($LNC % 2)) = 0 ]; then
- echo -n .
+ if [ "${VERBOSELEVEL}" != "nostats" ]; then
+ LNC=$(($LNC + 1))
+ if [ $(($LNC % 2)) = 0 ]; then
+ _pstr=`printf "%s... %d/%d" "${FPMPT}" ${LNC} ${FCNT}`
+ printf "\r%-${#_pstr}s\r%s" "" "${_pstr}"
+ fi
fi
done
- echo -n " "
+ # Print length-of-last-progress-string number of spaces followed
+ # by the final string.
+ printf "\r%-${#_pstr}s\r%s... done.\n" "" "${FPMPT}"
}
# Function for asking the user if everything is ok
@@ -1438,13 +1445,12 @@
if [ -s patchlist ]; then
# Attempt to fetch metadata patches
- echo -n "Fetching `wc -l < patchlist | tr -d ' '` "
- echo ${NDEBUG} "metadata patches.${DDSTATS}"
+ local _totalf=`wc -l < patchlist | tr -d ' '`
+ local _pmpt="Fetching ${_totalf} metadata patches"
tr '|' '-' < patchlist |
lam -s "${FETCHDIR}/tp/" - -s ".gz" |
xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \
- 2>${STATSREDIR} | fetch_progress
- echo "done."
+ 2>${STATSREDIR} | fetch_progress "${_pmpt}" ${_totalf}
# Attempt to apply metadata patches
echo -n "Applying metadata patches... "
@@ -1979,13 +1985,12 @@
fetch_files () {
# Attempt to fetch patches
if [ -s patchlist ]; then
- echo -n "Fetching `wc -l < patchlist | tr -d ' '` "
- echo ${NDEBUG} "patches.${DDSTATS}"
+ local _totalf=`wc -l < patchlist | tr -d ' '`
+ local _pmpt="Fetching ${_totalf} patches"
tr '|' '-' < patchlist |
lam -s "${PATCHDIR}/" - |
xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \
- 2>${STATSREDIR} | fetch_progress
- echo "done."
+ 2>${STATSREDIR} | fetch_progress "${_pmpt}" ${_totalf}
# Attempt to apply patches
echo -n "Applying patches... "
@@ -2013,12 +2018,13 @@
done < files.wanted > filelist
if [ -s filelist ]; then
- echo -n "Fetching `wc -l < filelist | tr -d ' '` "
- echo ${NDEBUG} "files... "
+ local _totalf=`wc -l < filelist | tr -d ' '`
+ local _pmpt="Fetching ${_totalf} files"
lam -s "${FETCHDIR}/f/" - -s ".gz" < filelist |
xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \
- 2>${STATSREDIR} | fetch_progress
+ 2>${STATSREDIR} | fetch_progress "${_pmpt}" ${_totalf}
+ echo -n "Extracting patches and verifying checksums... "
while read Y; do
if ! [ -f ${Y}.gz ]; then
echo "failed."
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 7:03 AM (8 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29253515
Default Alt Text
D39761.1784963039.diff (3 KB)
Attached To
Mode
D39761: freebsd-update: Print download progress in more terse way.
Attached
Detach File
Event Timeline
Log In to Comment