diff --git a/make/project.conf b/make/project.conf index 0b671c34..42932e4a 100644 --- a/make/project.conf +++ b/make/project.conf @@ -35,7 +35,7 @@ build = realpath build = realpath [pkg.requires.suse] -run = python3 +run = python3, python3-GitPython release = rpmbuild, pkg-config, python3-base [pkg.requires.debian] diff --git a/make/projects-dir-minimal.mk b/make/projects-dir-minimal.mk index c27b9e78..795ad46a 100644 --- a/make/projects-dir-minimal.mk +++ b/make/projects-dir-minimal.mk @@ -35,6 +35,8 @@ else ifneq ($(findstring ssh://git.janware.com,$(PROJECTS_DIR_REMOTE_BASE)),) $(warning Using janware SSH: $(PROJECTS_DIR_REMOTE_BASE)) else ifneq ($(findstring https://,$(PROJECTS_DIR_REMOTE_BASE)),) $(warning Using HTTPS: $(PROJECTS_DIR_REMOTE_BASE)) +else ifneq ($(wildcard $(PROJECTS_DIR_REMOTE_BASE)),) + $(warning Using local PROJECTS_DIR_REMOTE_BASE = $(PROJECTS_DIR_REMOTE_BASE)) else $(error Unsupported PROJECTS_DIR_REMOTE_BASE="$(PROJECTS_DIR_REMOTE_BASE)") endif diff --git a/src/python/jw/pkg/build/cmds/CmdListRepos.py b/src/python/jw/pkg/build/cmds/CmdListRepos.py index 1f7ff1c1..fec9f564 100644 --- a/src/python/jw/pkg/build/cmds/CmdListRepos.py +++ b/src/python/jw/pkg/build/cmds/CmdListRepos.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import re +import re, git, os from argparse import Namespace, ArgumentParser from ..Cmd import Cmd @@ -74,4 +74,18 @@ class CmdListRepos(Cmd): # export for repo in repos: print(repo['name']) return + if os.path.isdir(args.base_url): + for subdir in ["." , args.from_user]: + out = [] + for entry in os.scandir(args.base_url + "/" + subdir): + path = entry.path + try: + _ = git.Repo(path).git_dir + except: + continue + out.append(path) + if out: + print('\n'.join(out)) + break + return raise Exception(f'Don\'t know how to enumerate Git repos at base url {args.base_url}')