diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2024-01-04 17:30:01 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2024-01-04 19:04:32 +0300 |
commit | d77f50aab8f7727eebcfb122a10607f2f9f7d835 (patch) | |
tree | 26920c92fe37fff2744c570ea3b91b6037151be1 /calm/package.py | |
parent | 48dafae913459780cb081c8c31191ecbaf6b26f0 (diff) |
Isolate tests from a local repodir
This fixes the tests if a local /git/cygwin-packages happens to exist,
and adds some test coverage of code which examines repodir.
Diffstat (limited to 'calm/package.py')
-rwxr-xr-x | calm/package.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/calm/package.py b/calm/package.py index d135d80..f84d494 100755 --- a/calm/package.py +++ b/calm/package.py @@ -1396,12 +1396,13 @@ def upper_first_character(s): # # -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) +def _find_build_recipe_file(args, pn): + if args.repodir: + repo = os.path.join(args.repodir, '%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 @@ -1457,7 +1458,7 @@ def write_repo_json(args, packages, f): if 'license' in po.version_hints[bv]: d['license'] = po.version_hints[bv]['license'] - build_recipe = _find_build_recipe_file(po.orig_name) + build_recipe = _find_build_recipe_file(args, po.orig_name) if build_recipe: d['build_recipe'] = build_recipe |