Added variable generating_upstream_patch_defined. When set to 1, this
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 15 Oct 2009 07:14:54 +0000 (07:14 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 15 Oct 2009 07:14:54 +0000 (07:14 +0000)
variable tells the script specialize-patch to treat the preprocessor
symbol GENERATING_UPSTREAM_PATCH as defined.

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1218 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scripts/specialize-patch

index 1f560ef..cd9467b 100755 (executable)
@@ -105,6 +105,12 @@ function evaluate(stmnt) {
     gsub("defined *\\( *SCST_IO_CONTEXT *\\)", SCST_IO_CONTEXT, stmnt)
   }
 
+  if (generating_upstream_patch_defined)
+  {
+    gsub("defined  *GENERATING_UPSTREAM_PATCH", 1, stmnt)
+    gsub("defined *\\( *GENERATING_UPSTREAM_PATCH *\\)", 1, stmnt)
+  }
+
   do
   {
     last_stmnt = stmnt
@@ -192,6 +198,7 @@ function handle_if()
       || $0 ~ "RHEL_MAJOR"         \
       || $0 ~ "RHEL_MINOR"         \
       || $0 ~ "RHEL_RELEASE_CODE"  \
+      || $0 ~ "GENERATING_UPSTREAM_PATCH" \
       || $0 ~ "SCSI_EXEC_REQ_FIFO_DEFINED" \
       || $0 ~ "SCST_IO_CONTEXT")
   {
@@ -325,6 +332,8 @@ BEGIN {
   }
   if (delete_disabled_code != 0 && delete_disabled_code != 1)
     delete_disabled_code = 0
+  if (generating_upstream_patch_defined != 0 && generating_upstream_patch_defined != 1)
+    generating_upstream_patch_defined = 0
 
   # Variable initialization.
   reset_hunk_state_variables()