@@ -76,7 +76,7 @@ def process_bitbake_env(self, conf):
7676 for mline in lines :
7777 if re .search (
7878 "^(MANIFEST_FILE|DEPLOY_DIR|MACHINE_ARCH|DL_DIR|DEPLOY_DIR_RPM|"
79- "DEPLOY_DIR_IPK|DEPLOY_DIR_DEB|IMAGE_PKGTYPE)=" ,
79+ "DEPLOY_DIR_IPK|DEPLOY_DIR_DEB|IMAGE_PKGTYPE|LICENSE_DIR )=" ,
8080 mline ):
8181
8282 # if re.search('^TMPDIR=', mline):
@@ -98,6 +98,10 @@ def process_bitbake_env(self, conf):
9898 if not conf .download_dir :
9999 conf .download_dir = val
100100 logging .info (f"Bitbake Env: download_dir={ conf .download_dir } " )
101+ elif re .search ('^LICENSE_DIR=' , mline ):
102+ if not conf .license_dir :
103+ conf .license_dir = val
104+ logging .info (f"Bitbake Env: license_dir={ conf .license_dir } " )
101105 elif not rpm_dir and re .search ('^DEPLOY_DIR_RPM=' , mline ):
102106 rpm_dir = val
103107 logging .info (f"Bitbake Env: rpm_dir={ rpm_dir } " )
@@ -111,7 +115,7 @@ def process_bitbake_env(self, conf):
111115 conf .image_pkgtype = val
112116 logging .info (f"Bitbake Env: image_pkgtype={ conf .image_pkgtype } " )
113117
114- if conf .package_dir :
118+ if not conf .package_dir :
115119 if conf .image_pkgtype == 'rpm' and rpm_dir :
116120 conf .package_dir = rpm_dir
117121 elif conf .image_pkgtype == 'ipk' and ipk_dir :
@@ -123,10 +127,12 @@ def process_bitbake_env(self, conf):
123127 temppath = os .path .join (conf .build_dir , 'tmp' , 'deploy' )
124128 if os .path .isdir (temppath ):
125129 conf .deploy_dir = temppath
130+
126131 if not conf .download_dir :
127132 temppath = os .path .join (conf .build_dir , 'downloads' )
128133 if os .path .isdir (temppath ):
129134 conf .download_dir = temppath
135+
130136 if not conf .package_dir and conf .deploy_dir :
131137 temppath = os .path .join (conf .deploy_dir , conf .image_pkgtype )
132138 if os .path .isdir (temppath ):
@@ -219,25 +225,32 @@ def check_files(conf):
219225 machine = conf .machine .replace ('_' , '-' )
220226
221227 if not conf .license_manifest :
222- if not conf .target or not conf .machine :
223- logging .error ("Manifest file not specified and it could not be determined as Target not specified or "
224- "machine not identified from environment" )
225- return False
226- else :
227- manpath = os .path .join (conf .deploy_dir , "licenses" ,
228- f"{ conf .target } -{ machine } -*" , "license.manifest" )
229- manifest = ""
230- manlist = glob .glob (manpath )
231- if len (manlist ) > 0 :
232- # Get most recent file
233- manifest = manlist [- 1 ]
234-
235- if not os .path .isfile (manifest ):
236- logging .error (f"Manifest file '{ manifest } ' could not be located" )
228+ if conf .license_dir :
229+ manpath = os .path .join (conf .license_dir ,
230+ f"{ conf .target } -{ machine } " , "license.manifest" )
231+ if os .path .isfile (manpath ):
232+ conf .license_manifest = manpath
233+
234+ if not conf .license_manifest :
235+ if not conf .target or not conf .machine :
236+ logging .error ("Manifest file not specified and it could not be determined as Target not specified or "
237+ "machine not identified from environment" )
237238 return False
238239 else :
239- logging .info (f"Located license.manifest file { manifest } " )
240- conf .license_manifest = manifest
240+ manpath = os .path .join (conf .deploy_dir , "licenses" ,
241+ f"{ conf .target } -{ machine } -*" , "license.manifest" )
242+ manifest = ""
243+ manlist = glob .glob (manpath )
244+ if len (manlist ) > 0 :
245+ # Get most recent file
246+ manifest = manlist [- 1 ]
247+
248+ if not os .path .isfile (manifest ):
249+ logging .error (f"Manifest file '{ manifest } ' could not be located" )
250+ return False
251+ else :
252+ logging .info (f"Located license.manifest file { manifest } " )
253+ conf .license_manifest = manifest
241254
242255 imgdir = os .path .join (conf .deploy_dir , "images" , machine )
243256 if conf .cve_check_file != "" :
@@ -264,7 +277,7 @@ def get_pkg_files(conf):
264277 package_paths_list = glob .glob (pattern , recursive = True )
265278 package_files_list = []
266279 for path in package_paths_list :
267- package_files_list .append (os . path . basename ( path ) )
280+ package_files_list .append (path )
268281
269282 return package_files_list
270283
0 commit comments