def patch_count(self):
return len(self.patch_files)
+ @property
+ def has_valid_infra(self):
+ try:
+ if self.infras[0][1] == 'virtual':
+ return False
+ except IndexError:
+ return False
+ return True
+
def set_infra(self):
"""
Fills in the .infras field
"""
Fills in the .status['license'] and .status['license-files'] fields
"""
+ if not self.has_valid_infra:
+ self.status['license'] = ("na", "no valid package infra")
+ self.status['license-files'] = ("na", "no valid package infra")
+ return
+
var = self.pkgvar()
self.status['license'] = ("error", "missing")
self.status['license-files'] = ("error", "missing")
"""
Fills in the .status['hash'] field
"""
+ if not self.has_valid_infra:
+ self.status['hash'] = ("na", "no valid package infra")
+ self.status['hash-license'] = ("na", "no valid package infra")
+ return
+
hashpath = self.path.replace(".mk", ".hash")
if os.path.exists(hashpath):
self.status['hash'] = ("ok", "found")
"""
Fills in the .patch_count, .patch_files and .status['patches'] fields
"""
+ if not self.has_valid_infra:
+ self.status['patches'] = ("na", "no valid package infra")
+ return
+
pkgdir = os.path.dirname(self.path)
for subdir, _, _ in os.walk(pkgdir):
self.patch_files = fnmatch.filter(os.listdir(subdir), '*.patch')
for pkg, r in zip(packages, results):
pkg.latest_version = dict(zip(['status', 'version', 'id'], r))
+ if not pkg.has_valid_infra:
+ pkg.status['version'] = ("na", "no valid package infra")
+ continue
+
if pkg.latest_version['status'] == RM_API_STATUS_ERROR:
pkg.status['version'] = ('warning', "Release Monitoring API error")
elif pkg.latest_version['status'] == RM_API_STATUS_NOT_FOUND: