Refinements / bug fixes of the changes introduced in the previous commit:

- Only replace sBUG/sBUG_ON by BUG/BUG_ON when this macro is being used, not
  in its definition.
- Fixed bugs in algorithm for preserving the original code during a sparse run.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2009-09-06 11:09:21 +00:00
parent bea5b6dfc8
commit 9d4e2f9399
2 changed files with 23 additions and 8 deletions

View File

@@ -69,11 +69,19 @@ diff -uprN orig/linux-${kernel_version}/$2 linux-${kernel_version}/$2
+++ linux-${kernel_version}/$2
@@ -0,0 +1,$(wc -l "$1" | { read a b; echo $a; }) @@
EOF
if [ "${2%.[ch]}" != "$2" ]; then
sed -e 's/sBUG(/BUG(/g' -e 's/sBUG_ON(/BUG_ON(/g' -e 's/^/+/' \
-e 's/^ \([^ ]*:\)$/\1/' < "$1"
# Insert a '+'-sign at the start of each line.
sed -e 's/^/+/' < "$1" | \
if [ "${replace_sbug_by_bug}" = "true" ]; then
sed -e 's/sBUG(\([^)]\)/BUG(\1/g' -e 's/sBUG_ON(\([^)]\)/BUG_ON(\1/g'
else
sed -e 's/sBUG(/BUG(/g' -e 's/sBUG_ON(/BUG_ON(/g' -e 's/^/+/' < "$1"
cat
fi \
| \
if [ "${2%.[ch]}" != "$2" ]; then
# Make sure that labels (goto-targets) are left-aligned.
sed -e 's/^ \([^ ]*:\)$/\1/'
else
cat
fi
fi
}
@@ -138,6 +146,7 @@ mpt_scst="false"
multiple_patches="false"
patchdir=""
specialize_patch_options="-v delete_disabled_code=1"
replace_sbug_by_bug="true"
if [ ! -e scst -o ! -e iscsi-scst -o ! -e srpt -o ! -e scst_local ]; then
echo "Please run this script from inside the SCST subversion source tree."
@@ -151,7 +160,10 @@ do
'-h') usage; exit 1;;
'-l') shift;;
'-m') mpt_scst="true"; shift;;
'-n') specialize_patch_options="-v delete_disabled_code=0"; shift;;
'-n') specialize_patch_options="-v delete_disabled_code=0"
replace_sbug_by_bug="false"
shift
;;
'-p') multiple_patches="true"; patchdir="$2"; shift; shift;;
'-q') qla2x00t="true"; shift;;
'--') shift;;