Makes GetModSrc check the common folder when attempting to extract source files

This commit is contained in:
LexManos committed 2012-09-15 17:09:34 -07:00
1 parent 640446b868
commit 87104f0e2d
1 file changed
+20 -2
+20 -2
View File
@@ -200,10 +200,28 @@
# HINT: We need a table for the old md5 and the new ones
md5table = {}
@@ -1656,3 +1699,6 @@
@@ -1646,6 +1689,7 @@
# HINT: We extract the source files for the modified class files
for in_class in trgclasses:
src_file = os.path.normpath(os.path.join(src[side], in_class + '.java'))
+ cmn_file = os.path.normpath(os.path.join(self.srcshared, in_class + '.java'))
dest_file = os.path.normpath(os.path.join(outpathlk[side], in_class + '.java'))
if os.path.isfile(src_file):
if not os.path.exists(os.path.dirname(dest_file)):
@@ -1655,4 +1699,15 @@
self.logger.info('> Outputted %s to %s', in_class.ljust(35), outpathlk[side])
except IOError:
self.logger.error('* File %s copy failed', in_class)
-
+ elif os.path.isfile(cmn_file):
+ if not os.path.exists(os.path.dirname(dest_file)):
+ os.makedirs(os.path.dirname(dest_file))
+ try:
+ shutil.copyfile(cmn_file, dest_file)
+ self.logger.info('> Outputted %s to %s', in_class.ljust(35), outpathlk[side])
+ except IOError:
+ self.logger.error('* File %s copy failed', in_class)
+
+def commands_sanity_check():
+ print 'Commands patch applied successfully'
+