Skip to content

Commit

Permalink
Add package recipe URL to JSON dump
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-turney committed Dec 29, 2023
1 parent 2f50dae commit 6103afd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions calm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,20 @@ def upper_first_character(s):
return s[:1].upper() + s[1:]


#
#
#

def _find_build_recipe_file(pn):
repo = '/git/cygwin-packages/%s.git' % pn
if os.path.exists(repo):
# XXX: we might want to check contents of the repo to determine if this
# package has a cygport or g-b-s build script
return 'https://cygwin.com/cgit/cygwin-packages/%s/tree/%s.cygport' % (pn, pn)

return None


#
# write a json summary of packages
#
Expand Down Expand Up @@ -1443,6 +1457,10 @@ def package(p):
if 'license' in po.version_hints[bv]:
d['license'] = po.version_hints[bv]['license']

build_recipe = _find_build_recipe_file(po.orig_name)
if build_recipe:
d['build_recipe'] = build_recipe

if (po.orig_name in pkg_maintainers) and (not pkg_maintainers[po.orig_name].is_orphaned()):
d['maintainers'] = sorted(pkg_maintainers[po.orig_name].maintainers())

Expand Down

0 comments on commit 6103afd

Please sign in to comment.