diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2022-09-01 23:01:54 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2022-10-02 14:57:11 +0300 |
commit | 6b43121c139e47641efe32f68333aae7909b9162 (patch) | |
tree | 54e428c28897f8118bafd6a8f7db48445235bd1b /calm/pkg2html.py | |
parent | de93bbcc131909111ec43ab5c0bdadf3131b9ab0 (diff) |
Correctly linkify packages with a version-constraint
Diffstat (limited to 'calm/pkg2html.py')
-rwxr-xr-x | calm/pkg2html.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/calm/pkg2html.py b/calm/pkg2html.py index f6a2ada..4924847 100755 --- a/calm/pkg2html.py +++ b/calm/pkg2html.py @@ -147,10 +147,12 @@ def update_package_listings(args, packages): toremove = glob.glob(os.path.join(summaries, '*')) - def linkify_package(p): + def linkify_package(pkg): + p = re.sub(r'(.*)\s+\(.*\)', r'\1', pkg) if p in package_list: pn = arch_package(packages, p).orig_name - return '<a href="%s.html">%s</a>' % (p, pn) + text = re.sub(re.escape(p), pn, pkg) + return '<a href="%s.html">%s</a>' % (p, text) logging.debug('package linkification failed for %s' % p) return p |