macaroni-os / mark-issues

Macaroni Automated Repositories Kit Issues
4 stars 1 forks source link

[desktop-kit] `app-admin/passwordsafe` autogen is broken; generator may need maintenance/replacement #196

Open cuantar opened 23 hours ago

cuantar commented 23 hours ago

Output from merge-kits:

INFO     Autogen: net-print/hplip (latest)                                      
ERROR    local variable 'version' referenced before assignment                  
         Traceback (most recent call last):                                     
           File                                                                 
         "/usr/lib/python3.9/subpop/org.funtoo.metatools/pkgtools/autogen.py",  
         line 440, in gen_wrapper                                               
             await generate(AutoHub(autogen_id, pkgtools), **pkginfo)           
           File                                                                 
         "/home/tree/trees/dev/repo_tmp/source-trees/kit-fixups/desktop-kit/cura
         ted/app-admin/passwordsafe/autogen.py", line 19, in generate           
             **pkginfo, version=version,                                        
         artifacts=[hub.pkgtools.ebuild.Artifact(url=url,                       
         final_name=final_name)]                                                
         UnboundLocalError: local variable 'version' referenced before          
         assignment                                                             
INFO     Created: x11-wm/qtile/qtile-0.22.1.20230709.ebuild                     

Aside: The text above is an example of the mostly-useless error messages generated by merge-kits. In the case of autogens with a generalized generator like github-1, the source of the error is the generator, not autogen.py with a path which reveals the failing package. Sometimes it can be quite difficult to figure out what has broken. There's another issue about this already.

cuantar commented 15 hours ago

This patch fixes it. The string "Linux" does not appear in the name field (that actually is blank in almost all of the release metadata I looked at). Sometimes it is in the "body" field. It is possible that someone changed "Linux" to "non-Windows" at some point. The latest version upstream is 1.20.0 that is picked up by the autogen after this patch.

diff --git a/desktop-kit/curated/app-admin/passwordsafe/autogen.py b/desktop-kit/curated/app-admin/passwordsafe/autogen.py
index b33dad7b8..f075b67b3 100644
--- a/desktop-kit/curated/app-admin/passwordsafe/autogen.py
+++ b/desktop-kit/curated/app-admin/passwordsafe/autogen.py
@@ -9,7 +9,7 @@ async def generate(hub, **pkginfo):
        for release in json_list:
                if release["prerelease"] or release["draft"]:
                        continue
-               if "Linux" not in release["name"]:
+               if "Linux" not in release["body"]:
                        continue
                version = release["tag_name"]
                url = f"https://github.com/pwsafe/pwsafe/archive/{version}.tar.gz"