[tovid] r3409 committed - Remove suffix from sleep commands for compatibility....

0 views
Skip to first unread message

to...@googlecode.com

unread,
Dec 6, 2011, 12:00:20 AM12/6/11
to tovi...@googlegroups.com
Revision: 3409
Author: grepper
Date: Mon Dec 5 20:59:55 2011
Log: Remove suffix from sleep commands for compatibility.
Use base program name instead of full path for
send_to_log output.
Remove whitespace at beginning of CPU_MODEL name output.

http://code.google.com/p/tovid/source/detail?r=3409

Modified:
/trunk/tovid/src/tovid-init.in

=======================================
--- /trunk/tovid/src/tovid-init.in Sun Sep 25 19:42:30 2011
+++ /trunk/tovid/src/tovid-init.in Mon Dec 5 20:59:55 2011
@@ -278,11 +278,13 @@
# Wait for input file to appear
# After a 30-second timeout, exit gracefully
CUR_TIME=30
- while test $CUR_TIME -gt 0; do
+ while test $CUR_TIME -gt 0; do
+ sleep 3
# If file exists, wait a few more seconds, then break out
if test -e "$FOP_OUTFILE"; then
- printf "Processing started. Please
wait... "
- sleep 3s
+ $QUIET || printf "Processing started. Please
wait... "
+ sleep 1s
+ CUR_TIME=1
break
fi
printf "Waiting $CUR_TIME seconds for output file
\"$FOP_BASENAME_NAME\" to appear...\r"
@@ -324,7 +326,7 @@
FOP_LAST_SIZE=$FOP_CUR_SIZE
FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
done
- printf "\n\n"
+ $QUIET && printf "\n" || printf "\n\n"
}

#
******************************************************************************
@@ -442,11 +444,12 @@
# uses stdbuf (coreutils) if present so stdin is line buffered
send_to_log()
{
-[[$1]] && prog_name="[$1]: " || prog_name=$0
+ [[ $1 ]] && prog_name="[$1]: " || prog_name="[${0##*/}]: "
$std_buf tr "\015" "\n" < /dev/stdin | \
while read line; do
printf "%s %s\n" "$prog_name" "$line"
done
+ printf "\n"
}


@@ -467,7 +470,8 @@
KERNEL=$(uname)
if test "$KERNEL" = "Linux"; then
# Linux should have /proc/cpuinfo
- CPU_MODEL=$(awk -F ":" '/model name/ {print $2}' /proc/cpuinfo | head
-n 1)
+ CPU_MODEL=$(awk -F ":" '/model name/ {print $2}' \
+ /proc/cpuinfo | head -n 1 | sed 's/^ *//g')
CPU_SPEED=$(awk 'BEGIN { IGNORECASE = 1 } /MHz/ { print $4 }'
/proc/cpuinfo | head -n 1)
# Test for multiple CPUs. If they are available, try to use them.
if test $(grep "^processor" /proc/cpuinfo | wc -l) -ge "2"; then

Reply all
Reply to author
Forward
0 new messages