mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge branch 'topic/awelzel/collect-repo-info-softer-git-dependency'
* topic/awelzel/collect-repo-info-softer-git-dependency: ci/collect-repo-info: No hard dependency on git
This commit is contained in:
commit
6ee5c6e9cc
3 changed files with 28 additions and 8 deletions
9
CHANGES
9
CHANGES
|
@ -1,3 +1,12 @@
|
|||
6.0.0-dev.94 | 2023-02-22 19:29:52 +0100
|
||||
|
||||
* ci/collect-repo-info: No hard dependency on git (Arne Welzel, Corelight)
|
||||
|
||||
The OBS builds run in an environment where no git is installed and
|
||||
release tarballs assembled manually.
|
||||
|
||||
Drop the hard-requirement on git from ci/collect-repo-info.json.
|
||||
|
||||
6.0.0-dev.92 | 2023-02-22 16:49:36 +0100
|
||||
|
||||
* GH-2776: zeek-config: Move ZEEK_VERSION* out of zeek-config.h (Arne Welzel, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
6.0.0-dev.92
|
||||
6.0.0-dev.94
|
||||
|
|
|
@ -25,6 +25,16 @@ def git(*args, **kwargs):
|
|||
return subprocess.check_output([GIT, *args], **kwargs).decode("utf-8")
|
||||
|
||||
|
||||
def git_available():
|
||||
try:
|
||||
git("--version", stderr=subprocess.DEVNULL)
|
||||
return True
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def git_is_repo(d: pathlib.Path):
|
||||
try:
|
||||
git("-C", str(d), "rev-parse", "--is-inside-work-tree", stderr=subprocess.DEVNULL)
|
||||
|
@ -150,16 +160,14 @@ def main():
|
|||
logger.error("%s missing zeek-config.h.in", zeek_dir)
|
||||
return 1
|
||||
|
||||
try:
|
||||
git("--version")
|
||||
except OSError as e:
|
||||
logger.error("No git? (%s)", str(e))
|
||||
if args.only_git and not git_available():
|
||||
logger.error("git not found and --only-git provided")
|
||||
return 1
|
||||
|
||||
# Attempt to collect info from git first and alternatively
|
||||
# fall back to a repo-info.json file within what is assumed
|
||||
# to be a tarball.
|
||||
if git_is_repo(zeek_dir):
|
||||
if git_available() and git_is_repo(zeek_dir):
|
||||
info = collect_git_info(zeek_dir)
|
||||
elif not args.only_git:
|
||||
try:
|
||||
|
@ -167,10 +175,13 @@ def main():
|
|||
info = json.load(fp)
|
||||
info["source"] = "repo-info.json"
|
||||
except FileNotFoundError:
|
||||
logger.error("%s is not a git repo and repo-info.json missing", zeek_dir)
|
||||
git_info_msg = ""
|
||||
if not git_available():
|
||||
git_info_msg = " (git not found)"
|
||||
logger.error("%s has no repo-info.json%s", zeek_dir, git_info_msg)
|
||||
return 1
|
||||
else:
|
||||
logger.error("Not a git repo and --only-git provided")
|
||||
logger.error("%s is not a git repo and --only-git provided", zeek_dir)
|
||||
return 1
|
||||
|
||||
included_plugins_info = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue