From 9af236707ea379a0d719525f86348e1b39d88669 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 22 Oct 2008 17:47:28 +0000 Subject: [PATCH] The patch below implements the following changes: - Add a dummy Signed-off-by line to the generated patch, such that checkpatch doesn't complain that it's missing. - Sort the names of source files (through ls) before using these, such that the generated patch is the same during each run. - Fixed a bug in #elif handling (this bug is not triggered by the current SCST code). This patch has been tested by comparing the output of the old and the new generate-kernel-patch script. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@530 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/generate-kernel-patch | 19 +++++++++++-------- scripts/specialize-patch | 4 +++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 9034cd78f..989492270 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -133,6 +133,9 @@ else kernel_version="$1" fi +echo "Signed-off-by: ... <...@...>" +echo "" + kpatch=( \ "scst/kernel/scst_exec_req_fifo-${kernel_version}.patch" \ "iscsi-scst/kernel/patches/put_page_callback-${kernel_version}.patch" \ @@ -165,7 +168,7 @@ cat "${kpatch[@]}" # Directory include/scst/ -for f in scst/include/*h +for f in $(ls scst/include/*h) do add_file "${f}" "include/scst/${f#scst/include/}" done @@ -188,7 +191,7 @@ add_file "scst/kernel/in-tree/Makefile.scst" "drivers/scst/Makefile" add_file "scst/README_in-tree" "Documentation/scst/README.scst" -for f in scst/src/*.[ch] +for f in $(ls scst/src/*.[ch]) do add_file "${f}" "drivers/scst/${f#scst/src/}" done @@ -199,7 +202,7 @@ done add_file "scst/kernel/in-tree/Makefile.dev_handlers" \ "drivers/scst/dev_handlers/Makefile" -for f in scst/src/dev_handlers/*.[ch] +for f in $(ls scst/src/dev_handlers/*.[ch]) do add_file "${f}" "drivers/scst/dev_handlers/${f#scst/src/dev_handlers/}" done @@ -210,7 +213,7 @@ done # Make sure the file iscsi-scst/iscsi_scst_itf_ver.h is up to date. make -s -C iscsi-scst include/iscsi_scst_itf_ver.h -for f in iscsi-scst/include/*h +for f in $(ls iscsi-scst/include/*h) do add_file "${f}" "include/scst/${f#iscsi-scst/include/}" done @@ -220,7 +223,7 @@ add_file "iscsi-scst/kernel/Makefile.in-kernel" \ add_file "iscsi-scst/kernel/Kconfig" "drivers/scst/iscsi-scst/Kconfig" -for f in iscsi-scst/kernel/*.[ch] +for f in $(ls iscsi-scst/kernel/*.[ch]) do add_file "${f}" "drivers/scst/iscsi-scst/${f#iscsi-scst/kernel/}" done @@ -242,7 +245,7 @@ if [ "${qla2x00t}" = "true" ]; then add_file "qla2x00t/qla2x00-target/README" \ "Documentation/scst/README.qla2x00t" - for f in qla2x00t/qla2x00-target/*.[ch] + for f in $(ls qla2x00t/qla2x00-target/*.[ch]) do add_file "${f}" "drivers/scst/qla2xxx-target/${f#qla2x00t/qla2x00-target/}" done @@ -265,7 +268,7 @@ if [ "$srpt" = "true" ]; then add_file "srpt/README" "Documentation/scst/README.srpt" - for f in srpt/src/*.[ch] + for f in $(ls srpt/src/*.[ch]) do add_file "${f}" "drivers/scst/srpt/${f#srpt/src/}" done @@ -290,7 +293,7 @@ if [ "$mpt_scst" = "true" ]; then add_file "mpt/Kconfig" "drivers/message/fusion/mpt_scst/Kconfig" - for f in mpt/*.[ch] + for f in $(ls mpt/*.[ch]) do add_file "${f}" "drivers/message/fusion/mpt_scst/${f#mpt/}" done diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 8e58fd5c2..ec368a401 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -127,7 +127,9 @@ function handle_if() } else { - sub("^+#elif ", "+#if ! " + decision[if_nesting_level] + " && ", evaluated) + sub("^+#elif ", + sprintf("+#if ! %d \\&\\& ", decision[if_nesting_level]), + evaluated) evaluated = evaluate(evaluated) } decision[if_nesting_level] = evaluated