Compare commits

...

No commits in common. "c9-beta" and "c9s" have entirely different histories.
c9-beta ... c9s

7 changed files with 108 additions and 2 deletions

View File

@ -1 +1 @@
61dea2640816c46b2f681b2d2f6882d9690f3904 SOURCES/butane-0.20.0.tar.gz
61dea2640816c46b2f681b2d2f6882d9690f3904 butane-0.20.0.tar.gz

8
.gitignore vendored
View File

@ -1 +1,7 @@
SOURCES/butane-0.20.0.tar.gz
/butane-0.13.1.tar.gz
/butane-0.14.0.tar.gz
/butane-0.16.0.tar.gz
/butane-0.17.0.tar.gz
/butane-0.18.0.tar.gz
/butane-0.19.0.tar.gz
/butane-0.20.0.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} # this is the testcase identifier, which OSCI pipeline uses

84
go-mods-to-bundled-provides.py Executable file
View File

@ -0,0 +1,84 @@
#!/usr/bin/env python3
'''
Tiny dumb script that generates virtual bundled `Provides` from a repo that
uses go modules and vendoring.
'''
import sys
import re
def main():
repos = get_repos_from_go_mod()
print_provides_from_modules_txt(repos)
def get_repos_from_go_mod():
repos = {}
in_reqs = False
for line in open('go.mod'):
line = line.strip()
if in_reqs and line.startswith(')'):
break
if not in_reqs:
if line.startswith('require ('):
in_reqs = True
continue
req = line.split()
repo = req[0]
tag = req[1]
repos[repo] = go_mod_tag_to_rpm_provides_version(tag)
return repos
def go_mod_tag_to_rpm_provides_version(tag):
# go.mod tags are either exact git tags, or may be "pseudo-versions". We
# want to convert these tags to something resembling a version string that
# RPM won't fail on. For more information, see
# https://golang.org/cmd/go/#hdr-Pseudo_versions and following sections.
# trim off any +incompatible
if tag.endswith('+incompatible'):
tag = tag[:-len('+incompatible')]
# git tags are normally of the form v$VERSION
if tag.startswith('v'):
tag = tag[1:]
# is this a pseudo-version? e.g. v0.0.0-20181031085051-9002847aa142
m = re.match("(.*)-([0-9.]+)-([a-f0-9]{12})", tag)
if m:
# rpm doesn't like multiple dashes in the version, so just merge the
# timestamp and the commit checksum into the "release" field
tag = f"{m.group(1)}-{m.group(2)}.git{m.group(3)}"
return tag
def print_provides_from_modules_txt(repos):
for line in open('vendor/modules.txt'):
if line.startswith('#'):
continue
gopkg = line.strip()
repo = lookup_repo_for_pkg(repos, gopkg)
if not repo:
# must be a pkg for tests only; ignore
continue
tag = repos[repo]
print(f"Provides: bundled(golang({gopkg})) = {tag}")
def lookup_repo_for_pkg(repos, gopkg):
for repo in repos:
if gopkg.startswith(repo):
return repo
if __name__ == '__main__':
sys.exit(main())

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (butane-0.20.0.tar.gz) = b9cc9e61fcd1681a156b1b91f70a47037bd6da84fb1e9bc033fda90b3143360e4ea77cd22ff75d283b5c2c8b24123e192181d74fb4f0b33f1b3e31ca38cac739

9
tests/tests.yml Normal file
View File

@ -0,0 +1,9 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple:
dir: .
run: "butane --help"