diff --git a/support/scripts/pkg-stats-new b/support/scripts/pkg-stats-new index 85a6caeeb9..c4174877aa 100755 --- a/support/scripts/pkg-stats-new +++ b/support/scripts/pkg-stats-new @@ -36,6 +36,7 @@ class Package: self.has_hash = False self.patch_count = 0 self.warnings = 0 + self.current_version = None def __eq__(self, other): return self.path == other.path @@ -148,6 +149,7 @@ def add_pkg_make_info(packages): """ licenses = list() license_files = list() + versions = dict() # Licenses o = subprocess.check_output(["make", "BR2_HAVE_DOT_CONFIG=y", @@ -187,12 +189,33 @@ def add_pkg_make_info(packages): license_files.append(pkgvar) + # Version + o = subprocess.check_output(["make", "BR2_HAVE_DOT_CONFIG=y", + "-s", "printvars", "VARS=%_VERSION"]) + for l in o.splitlines(): + # Get variable name and value + pkgvar, value = l.split("=") + + # If present, strip HOST_ from variable name + if pkgvar.startswith("HOST_"): + pkgvar = pkgvar[5:] + + if pkgvar.endswith("_DL_VERSION"): + continue + + # Strip _VERSION + pkgvar = pkgvar[:-8] + + versions[pkgvar] = value + for pkg in packages: var = pkgname_to_pkgvar(pkg.name) if var in licenses: pkg.has_license = True if var in license_files: pkg.has_license_files = True + if var in versions: + pkg.current_version = versions[var] def add_hash_info(packages): @@ -387,6 +410,9 @@ def dump_html_pkg(f, pkg): f.write("