mirror of
https://github.com/pentoo/pentoo-overlay
synced 2025-12-06 08:25:01 +01:00
repology_check: fix name detection in the new API
This commit is contained in:
parent
0ec8e29a55
commit
bacd9d49db
1 changed files with 13 additions and 5 deletions
|
|
@ -28,6 +28,11 @@ ignore_packages = {
|
|||
|
||||
json_data = None
|
||||
|
||||
def remove_prefix(text, prefix):
|
||||
if text.startswith(prefix):
|
||||
return text[len(prefix):]
|
||||
return text # or whatever
|
||||
|
||||
def load_api():
|
||||
global json_data
|
||||
|
||||
|
|
@ -59,19 +64,22 @@ def main():
|
|||
#find the newest version
|
||||
if package["status"] == "newest":
|
||||
package_version_newest = package["version"]
|
||||
|
||||
#find the current outdated in Pentoo
|
||||
if package["repo"] == "gentoo_ovl_pentoo" and package["status"] == "outdated":
|
||||
# gentoo_package_fullname = package["categories"][0] + "/" + package["srcname"]
|
||||
gentoo_package_name = package["srcname"]
|
||||
gentoo_package_version = package["version"]
|
||||
gentoo_package_category = package["categories"][0]
|
||||
gentoo_package_name = remove_prefix(package["srcname"],gentoo_package_category+"/")
|
||||
if package["origversion"]:
|
||||
gentoo_package_version = package["origversion"]
|
||||
else:
|
||||
gentoo_package_version = package["version"]
|
||||
|
||||
#do not display some known packages
|
||||
if gentoo_package_name in ignore_packages:
|
||||
continue
|
||||
#print the outdated list
|
||||
print ("cp " + gentoo_package_name + "-" + gentoo_package_version + ".ebuild " + \
|
||||
gentoo_package_name + "-"+ package_version_newest + ".ebuild")
|
||||
print ("cp " + gentoo_package_category + "/" + gentoo_package_name + "/" + gentoo_package_name + "-" + gentoo_package_version + ".ebuild " + \
|
||||
gentoo_package_category + "/" + gentoo_package_name + "/" + gentoo_package_name + "-"+ package_version_newest + ".ebuild")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue