mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
support/scripts/pkg-stats: store patch files for the package
Remove the patch_count attribute and use a class property instead. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
c46e707182
commit
b1916b0a8d
@ -64,7 +64,7 @@ class Package:
|
|||||||
self.has_license = False
|
self.has_license = False
|
||||||
self.has_license_files = False
|
self.has_license_files = False
|
||||||
self.has_hash = False
|
self.has_hash = False
|
||||||
self.patch_count = 0
|
self.patch_files = []
|
||||||
self.warnings = 0
|
self.warnings = 0
|
||||||
self.current_version = None
|
self.current_version = None
|
||||||
self.url = None
|
self.url = None
|
||||||
@ -93,6 +93,10 @@ class Package:
|
|||||||
self.url_status = "Missing"
|
self.url_status = "Missing"
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def patch_count(self):
|
||||||
|
return len(self.patch_files)
|
||||||
|
|
||||||
def set_infra(self):
|
def set_infra(self):
|
||||||
"""
|
"""
|
||||||
Fills in the .infras field
|
Fills in the .infras field
|
||||||
@ -131,10 +135,9 @@ class Package:
|
|||||||
"""
|
"""
|
||||||
Fills in the .patch_count field
|
Fills in the .patch_count field
|
||||||
"""
|
"""
|
||||||
self.patch_count = 0
|
|
||||||
pkgdir = os.path.dirname(self.path)
|
pkgdir = os.path.dirname(self.path)
|
||||||
for subdir, _, _ in os.walk(pkgdir):
|
for subdir, _, _ in os.walk(pkgdir):
|
||||||
self.patch_count += len(fnmatch.filter(os.listdir(subdir), '*.patch'))
|
self.patch_files = fnmatch.filter(os.listdir(subdir), '*.patch')
|
||||||
|
|
||||||
def set_current_version(self):
|
def set_current_version(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user