security: Copy back generated .dat to source dir 39/21339/3
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Tue, 4 Jul 2017 12:48:06 +0000 (14:48 +0200)
committerPhil Coval <philippe.coval@osg.samsung.com>
Tue, 11 Jul 2017 12:22:41 +0000 (12:22 +0000)
Also prevent a scons dependency issue when cleaning
May relate to:
http://scons.tigris.org/issues/show_bug.cgi?id=2777

Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: Id8abd40fb675f7ab198775fe55facebc15e1b1ef
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21339
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
build_common/SConscript

index 5677b51..04dbe23 100755 (executable)
@@ -853,7 +853,7 @@ env.Append(BUILDERS = {'Cbor' : builder})
 
 def ScanJSON(env, directory):
     actions = []
-    if env.get('SECURED') != '1':
+    if env.GetOption('clean') or env.get('SECURED') != '1':
         return actions
     dst_dir = env.get('BUILD_DIR') + '/' + directory + '/'
     src_dir = env.get('SRC_DIR') + '/' + directory + '/'
@@ -867,7 +867,7 @@ def ScanJSON(env, directory):
             cbor_file = Flatten(cbor_file)[0].name
             src = dst_dir + cbor_file
             dst = src_dir + cbor_file
-            Copy(dst, src)
+            Command(dst, src, Copy("$TARGET", "$SOURCE"))
         actions += cbor_file
     return actions