Merge fix
authortimothy.murphy@nokia.com
Mon, 01 Mar 2010 17:57:13 +0200
branchfix
changeset 288 80540207516e
parent 278 c38bfd29ee57 (diff)
parent 287 4c84bb0f4c67 (current diff)
child 289 91bbfbf8c43e
Merge
sbsv2/raptor/RELEASE-NOTES.txt
sbsv2/raptor/python/raptor_meta.py
--- a/sbsv2/raptor/RELEASE-NOTES.txt	Mon Mar 01 17:49:12 2010 +0200
+++ b/sbsv2/raptor/RELEASE-NOTES.txt	Mon Mar 01 17:57:13 2010 +0200
@@ -3,6 +3,7 @@
 next version
 
 Defect Fixes:
+- SF Bug 2081 - [Raptor] - Exported file executable permissions not maintained (linux)
 - Fix: host attribute in recipes was blank in windows, windows cluster builds.
 - SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
 - SF Bug 2042 - [Raptor] component field empty in recipe
--- a/sbsv2/raptor/lib/flm/tracecompiler.mk	Mon Mar 01 17:49:12 2010 +0200
+++ b/sbsv2/raptor/lib/flm/tracecompiler.mk	Mon Mar 01 17:57:13 2010 +0200
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -13,15 +13,34 @@
 # Description:
 # Run Trace Compiler on source files to generate trace headers and decode files
 
+# Set project name as <mmp_name>
 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
+
+TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
+
 # Find out TRACE_PATH
+# first look for .*/traces/traces_<target_name>_<target_extension>
+TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces/traces_$(TARGET)_$(TARGETEXT),$(DIR))))
+
+ifneq ($(TRACE_PATH),)
+# set project name as <target_name>_<target_extension> instead of <mmp_name>
+TRACE_PRJNAME:=$(TARGET)_$(TARGETEXT)
+endif
+
+# if not found look for .*/traces_<mmp_name>
+ifeq ($(TRACE_PATH),)
 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
+endif
+
+# if not found look for .*/traces
 ifeq ($(TRACE_PATH),)
 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
 endif
+
+# if not found look for .*/traces_<target_name>_<target_type>
 ifeq ($(TRACE_PATH),)
 TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
-# Use target name instead of mmp file name
+# set project name as <target_name>_<target_type> instead of <mmp_name>
 TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
 endif
 
@@ -33,8 +52,6 @@
 
 # Run trace compiler only if TRACE_PATH exists
 ifneq ($(TRACE_PATH),)
-
-
 TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
 TRACE_HEADERS:=
 
@@ -72,7 +89,7 @@
 	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
-	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) &&  \
+	$(JAVA_COMMAND) $(TRACE_COMPILER_START) -vb $(UID_TC) &&  \
 	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
 	{ $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
 	$(call endrule,tracecompile)
--- a/sbsv2/raptor/python/raptor_meta.py	Mon Mar 01 17:49:12 2010 +0200
+++ b/sbsv2/raptor/python/raptor_meta.py	Mon Mar 01 17:57:13 2010 +0200
@@ -2826,8 +2826,10 @@
 
 			sourceMTime = 0
 			destMTime = 0
+			sourceStat = 0
 			try:
-				sourceMTime = os.stat(source_str)[stat.ST_MTIME]
+				sourceStat = os.stat(source_str)
+				sourceMTime = sourceStat[stat.ST_MTIME]
 				destMTime = os.stat(dest_str)[stat.ST_MTIME]
 			except OSError, e:
 				if sourceMTime == 0:
@@ -2841,6 +2843,9 @@
 				if os.path.exists(dest_str):
 					os.chmod(dest_str,stat.S_IREAD | stat.S_IWRITE)
 				shutil.copyfile(source_str, dest_str)
+
+				# Ensure that the destination file remains executable if the source was also:
+				os.chmod(dest_str,sourceStat[stat.ST_MODE] | stat.S_IREAD | stat.S_IWRITE | stat.S_IWGRP ) 
 				self.__Raptor.Info("Copied %s to %s", source_str, dest_str)
 			else:
 				self.__Raptor.Info("Up-to-date: %s", dest_str)
--- a/sbsv2/raptor/test/smoke_suite/export.py	Mon Mar 01 17:49:12 2010 +0200
+++ b/sbsv2/raptor/test/smoke_suite/export.py	Mon Mar 01 17:57:13 2010 +0200
@@ -35,6 +35,7 @@
 		"simple_exp1.h exported_1.h\n"
 		"simple_exp2.h exported_2.h\n"
 		"simple_exp3.h exported_3.h\n"
+		"executable_file executable_file\n"
 		'"file with a space.doc" "exportedfilewithspacesremoved.doc"\n'
 		'"file with a space.doc" "exported file with a space.doc"\n\n'
 
@@ -59,6 +60,7 @@
 		"/tmp/$(USER)/simple_exp1.h",
 		"/tmp/$(USER)/simple_exp2.h",
 		"/tmp/$(USER)/simple_exp3.h",
+		"$(EPOCROOT)/epoc32/include/executable_file",
 		"$(EPOCROOT)/epoc32/include/simple_exp4.h"
 		]
 	t.run()
@@ -66,15 +68,31 @@
 		result = SmokeTest.FAIL
 
 
+	t = SmokeTest()
+	t.id = "0023a1"
+	t.name = "export"
+	t.usebash = True
+	t.command = "ls -l ${EPOCROOT}/epoc32/include/executable_file"
+	t.mustmatch = [ "^.rwxrwxr.x .*executable_file.*$" ]
+	t.targets = []
+	t.run()
+	t.usebash = False
+
+	if t.result == SmokeTest.FAIL:
+		result = SmokeTest.FAIL
+
+
 	# Testing if clean deletes any exports which it is not supposed to
 	t.id = "0023b"
 	t.name = "export_clean" 
 	t.command = "sbs -b smoke_suite/test_resources/simple_export/expbld.inf " \
 			+ "-c armv5 clean"
+	t.mustmatch = []
 	t.targets = [
 		"$(EPOCROOT)/epoc32/include/exported_1.h",
 		"$(EPOCROOT)/epoc32/include/exported_2.h",
 		"$(EPOCROOT)/epoc32/include/exported_3.h",
+		"$(EPOCROOT)/epoc32/include/executable_file",
 		"$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc",
 		"$(EPOCROOT)/epoc32/include/exported file with a space.doc",
 		"/tmp/$(USER)/simple_exp1.h",
@@ -95,6 +113,7 @@
 		'$(EPOCROOT)/epoc32/include/exported_1.h',
 		'$(EPOCROOT)/epoc32/include/exported_2.h',
 		'$(EPOCROOT)/epoc32/include/exported_3.h',
+		"$(EPOCROOT)/epoc32/include/executable_file",
 		'$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc',
 		'$(EPOCROOT)/epoc32/include/exported file with a space.doc',
 		'/tmp/$(USER)/simple_exp1.h',
@@ -116,6 +135,7 @@
 		'$(EPOCROOT)/epoc32/include/exported_1.h',
 		'$(EPOCROOT)/epoc32/include/exported_2.h',
 		'$(EPOCROOT)/epoc32/include/exported_3.h',
+		"$(EPOCROOT)/epoc32/include/executable_file",
 		'$(EPOCROOT)/epoc32/include/exportedfilewithspacesremoved.doc',
 		'$(EPOCROOT)/epoc32/include/exported file with a space.doc',
 		'/tmp/$(USER)/simple_exp1.h',
--- a/sbsv2/raptor/test/smoke_suite/test_resources/simple_export/bld.inf	Mon Mar 01 17:49:12 2010 +0200
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/simple_export/bld.inf	Mon Mar 01 17:57:13 2010 +0200
@@ -26,6 +26,7 @@
 simple_exp3.h exported_3.h
 "file with a space.doc" "exportedfilewithspacesremoved.doc"
 "file with a space.doc" "exported file with a space.doc"
+executable_file	executable_file
 
 simple_exp1.h /tmp/$$(USER)/  //
 simple_exp2.h \tmp\$$(USER)/  //