diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2004-06-03 22:11:03 +0000 |
---|---|---|
committer | Tim Yamin <plasmaroo@gentoo.org> | 2004-06-03 22:11:03 +0000 |
commit | 27d080602a52eceda47340d142cf1c5a1dc87510 (patch) | |
tree | 61ad850654f183ac78c911d3a7461ddd83b31ba6 /gen_funcs.sh | |
parent | Modularized parallel support in the X86 2.6 configuration. (diff) | |
download | genkernel-27d080602a52eceda47340d142cf1c5a1dc87510.tar.gz genkernel-27d080602a52eceda47340d142cf1c5a1dc87510.tar.bz2 genkernel-27d080602a52eceda47340d142cf1c5a1dc87510.zip |
New release:
* Busybox patched to support loops on 2.4 thus giving 2.4 squashfs
support.
* Various bug fixes; #46167, #46278, #47551, #48219, #48308,
#48339, #49728, #51395, #51948.
* Speedups: "" > ''; [ ! ... ] && > [ ... ] || et al where
applicable.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@106 67a159dc-881f-0410-a524-ba9dfbe2cb84
Diffstat (limited to 'gen_funcs.sh')
-rwxr-xr-x | gen_funcs.sh | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/gen_funcs.sh b/gen_funcs.sh index 8395bd2..9f6e5bf 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -21,14 +21,8 @@ isTrue() { return 1 } - if isTrue ${USECOLOR} then -# COLS="`stty size 2> /dev/null`" -# COLS="`getcols ${COLS}`" -# COLS=$((${COLS} - 7)) -# ENDCOL=$'\e[A\e['${COLS}'G' # Now, ${ENDCOL} will move us to the end of the - # column; irregardless of character width GOOD=$'\e[32;01m' WARN=$'\e[33;01m' BAD=$'\e[31;01m' @@ -36,57 +30,56 @@ then BOLD=$'\e[0;01m' UNDER=$'\e[4m' else - GOOD="" - WARN="" - BAD="" - NORMAL="" - BOLD="" - UNDER="" + GOOD='' + WARN='' + BAD='' + NORMAL='' + BOLD='' + UNDER='' fi - # print_info(debuglevel, print [, newline [, prefixline [, forcefile ] ] ]) print_info() { local NEWLINE=1 local FORCEFILE=0 local PREFIXLINE=1 local SCRPRINT=0 - local STR="" + local STR='' # NOT ENOUGH ARGS - if [ "$#" -lt "2" ] ; then return 1; fi + if [ "$#" -lt '2' ] ; then return 1; fi # IF 3 OR MORE ARGS, CHECK IF WE WANT A NEWLINE AFTER PRINT - if [ "$#" -gt "2" ] + if [ "$#" -gt '2' ] then if isTrue "$3" then - NEWLINE="1"; + NEWLINE='1'; else - NEWLINE="0"; + NEWLINE='0'; fi fi # IF 4 OR MORE ARGS, CHECK IF WE WANT TO PREFIX WITH A * - if [ "$#" -gt "3" ] + if [ "$#" -gt '3' ] then if isTrue "$4" then - PREFIXLINE="1" + PREFIXLINE='1' else - PREFIXLINE="0" + PREFIXLINE='0' fi fi # IF 5 OR MORE ARGS, CHECK IF WE WANT TO FORCE OUTPUT TO DEBUG # FILE EVEN IF IT DOESN'T MEET THE MINIMUM DEBUG REQS - if [ "$#" -gt "4" ] + if [ "$#" -gt '4' ] then if isTrue "$5" then - FORCEFILE="1" + FORCEFILE='1' else - FORCEFILE="0" + FORCEFILE='0' fi fi @@ -94,26 +87,26 @@ print_info() { # OR EQUAL TO SET DEBUG LEVEL if [ "$1" -lt "${DEBUGLEVEL}" -o "$1" -eq "${DEBUGLEVEL}" ] then - SCRPRINT="1" + SCRPRINT='1' fi # RETURN IF NOT OUTPUTTING ANYWHERE - if [ "${SCRPRINT}" != "1" -a "${FORCEFILE}" != "1" ] + if [ "${SCRPRINT}" != '1' -a "${FORCEFILE}" != '1' ] then return 0 fi # STRUCTURE DATA TO BE OUTPUT TO SCREEN, AND OUTPUT IT - if [ "${SCRPRINT}" -eq "1" ] + if [ "${SCRPRINT}" -eq '1' ] then - if [ "${PREFIXLINE}" = "1" ] + if [ "${PREFIXLINE}" = '1' ] then STR="${GOOD}*${NORMAL} ${2}" else STR="${2}" fi - if [ "${NEWLINE}" = "0" ] + if [ "${NEWLINE}" = '0' ] then echo -ne "${STR}" else @@ -122,21 +115,21 @@ print_info() { fi # STRUCTURE DATA TO BE OUTPUT TO FILE, AND OUTPUT IT - if [ "${SCRPRINT}" -eq "1" -o "${FORCEFILE}" -eq "1" ] + if [ "${SCRPRINT}" -eq '1' -o "${FORCEFILE}" -eq '1' ] then STRR=${2//${WARN}/} STRR=${STRR//${BAD}/} STRR=${STRR//${BOLD}/} STRR=${STRR//${NORMAL}/} - if [ "${PREFIXLINE}" = "1" ] + if [ "${PREFIXLINE}" = '1' ] then STR="* ${STRR}" else STR="${STRR}" fi - if [ "${NEWLINE}" = "0" ] + if [ "${NEWLINE}" = '0' ] then echo -ne "${STR}" >> ${DEBUGFILE} else @@ -161,6 +154,7 @@ print_warning() # $1 = variable name # $2 = variable value # $3 = string + var_replace() { echo "${3}" | sed -e "s/%%${1}%%/${2}/g" - @@ -176,7 +170,7 @@ clear_log() { } gen_die() { - if [ "$#" -gt "0" ] + if [ "$#" -gt '0' ] then print_error 1 "ERROR: ${1}" fi @@ -186,7 +180,7 @@ gen_die() { if isTrue ${USECOLOR} then - GREP_COLOR="1" grep -B5 -E --colour=always "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE} + GREP_COLOR='1' grep -B5 -E --colour=always "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE} else grep -B5 -E "([Ww][Aa][Rr][Nn][Ii][Nn][Gg]|[Ee][Rr][Rr][Oo][Rr][ :,!]|[Ff][Aa][Ii][Ll][Ee]?[Dd]?)" ${DEBUGFILE} fi @@ -196,19 +190,19 @@ gen_die() { print_info 1 "Please consult ${DEBUGFILE} for more information and any" print_info 1 "errors that were reported above." echo - print_info 1 "Report any real genkernel bugs to bugs.gentoo.org and" + print_info 1 "Report any genkernel bugs to bugs.gentoo.org and" print_info 1 "assign your bug to genkernel@gentoo.org. Please include" print_info 1 "as much information as you can in your bug report; attaching" print_info 1 "${DEBUGFILE} so that your issue can be dealt with effectively." print_info 1 '' - print_info 1 "DO ${BAD}NOT${NORMAL} REPORT KERNEL COMPILE FAILURES AS GENKERNEL BUGS!" + print_info 1 'Please do *not* report compilation failures as genkernel bugs!' print_info 1 '' exit 1 } has_loop() { dmesg | egrep -q '^loop:' - if [ -e "/dev/loop0" -o -e "/dev/loop/0" -a $? ] + if [ -e '/dev/loop0' -o -e '/dev/loop/0' -a $? ] then # We found devfs or standard dev loop device, assume # loop is compiled into the kernel or the module is loaded |