[TCT][Scripts][Non-ACR] Making install.log file profile/arch wise 28/324828/2
authorutk.tiwari <utk.tiwari@samsung.com>
Tue, 27 May 2025 10:26:07 +0000 (15:56 +0530)
committerutk.tiwari <utk.tiwari@samsung.com>
Tue, 27 May 2025 12:16:40 +0000 (17:46 +0530)
Change-Id: I35be7bc26fce770d2835c862fbaedaeb7473ac42
Signed-off-by: utk.tiwari <utk.tiwari@samsung.com>
scripts_tpk/tpk-install.py
scripts_tpk/tpksdk-install.py

index 96df9ac303ed66ac620f376605b112ea83a0c82d..f04627dc609f99c76663d674ab08d46a3dcf4fd1 100755 (executable)
@@ -56,8 +56,10 @@ def removeDir(path):
 
 def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE):
        rpmCheck=False
+       global TYPE_GIVEN
        global INSTALL_PKG_COUNT
        if ( TYPE == None ):
+               TYPE_GIVEN=False
                install('ctc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
                install('itc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
                install('utc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
@@ -196,7 +198,10 @@ def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE):
                        print('**************Task finished successfully*********************')
                        print('')
                        os.chdir(PROJECT_DIR)
-                       logFile=open('install.log', 'a')
+                       if TYPE_GIVEN:
+                               logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'_'+TYPE+'.log', 'a')
+                       else:
+                               logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'.log', 'a')
                        logFile.write(TYPE+':->'+MODNAME+'\n')
                        logFile.close()
                        INSTALL_PKG_COUNT+=1
@@ -261,11 +266,16 @@ if ( len(sys.argv) >= 6 ):
 if ( len(sys.argv) >= 7 ):
        module=sys.argv[6]
 
+if build_ctype:
+       TYPE_GIVEN=True
+       INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'_'+build_ctype+'.log'
+else:
+       INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'.log'
 
-if ( os.path.exists('install.log') ):
-       os.remove('install.log')
+if ( os.path.exists(INSTALL_LOG_PATH) ):
+       os.remove(INSTALL_LOG_PATH)
 
-instLog=open('install.log', 'w')
+instLog=open(INSTALL_LOG_PATH, 'w')
 instLog.write('**********************************************\n')
 instLog.write('Following packages get installed successfully:\n')
 instLog.close()
@@ -273,15 +283,15 @@ instLog.close()
 install(build_ctype, module, profile,tc_count, arch, is_coverage)
 
 if ( module == None ):
-       instLog=open('install.log', 'a')
+       instLog=open(INSTALL_LOG_PATH, 'a')
        instLog.write('**********************************************\n')
        instLog.write('Total Intall PASS Count = ' + str(INSTALL_PKG_COUNT) + '\n')
        instLog.close()
-       instLog=open('install.log')
+       instLog=open(INSTALL_LOG_PATH)
        for line in instLog:
                print(line.strip('\n'))
        instLog.close()
 
-os.remove('install.log')
+os.remove(INSTALL_LOG_PATH)
 
 
index 5431218244c8cc4ba4209d41ef317de7f28dcbff..26abe7fc941bba63d9a19a2f9120dfc4eb08888b 100755 (executable)
@@ -56,8 +56,10 @@ def removeDir(path):
 
 def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE):
        rpmCheck=False
+       global TYPE_GIVEN
        global INSTALL_PKG_COUNT
        if ( TYPE == None ):
+               TYPE_GIVEN=False
                install('ctc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
                install('itc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
                install('utc', None, PROFILE, TC_COUNT, ARCH, COVERAGE)
@@ -187,7 +189,10 @@ def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE):
                        print('**************Task finished successfully*********************')
                        print('')
                        os.chdir(PROJECT_DIR)
-                       logFile=open('install.log', 'a')
+                       if TYPE_GIVEN:
+                               logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'_'+TYPE+'.log', 'a')
+                       else:
+                               logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'.log', 'a')
                        logFile.write(TYPE+':->'+MODNAME+'\n')
                        logFile.close()
                        INSTALL_PKG_COUNT+=1
@@ -255,10 +260,16 @@ if ( arch == 'x86_64' ):
 if ( arch == 'riscv64' ):
        arch='riscv64'
 
-if ( os.path.exists('install.log') ):
-       os.remove('install.log')
+if build_ctype:
+       TYPE_GIVEN=True
+       INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'_'+build_ctype+'.log'
+else:
+       INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'.log'
+
+if ( os.path.exists(INSTALL_LOG_PATH) ):
+       os.remove(INSTALL_LOG_PATH)
 
-instLog=open('install.log', 'w')
+instLog=open(INSTALL_LOG_PATH, 'w')
 instLog.write('**********************************************\n')
 instLog.write('Following packages get installed successfully:\n')
 instLog.close()
@@ -266,13 +277,13 @@ instLog.close()
 install(build_ctype, module, profile,tc_count, arch, is_coverage)
 
 if ( module == None ):
-       instLog=open('install.log', 'a')
+       instLog=open(INSTALL_LOG_PATH, 'a')
        instLog.write('**********************************************\n')
        instLog.write('Total Intall PASS Count = ' + str(INSTALL_PKG_COUNT) + '\n')
        instLog.close()
-       instLog=open('install.log')
+       instLog=open(INSTALL_LOG_PATH)
        for line in instLog:
                print(line.strip('\n'))
        instLog.close()
 
-os.remove('install.log')
+os.remove(INSTALL_LOG_PATH)