| |
@@ -53,7 +53,7 @@
|
| |
return datetime.fromtimestamp(os.stat(path).st_mtime, timezone.utc).isoformat()
|
| |
|
| |
|
| |
- @jinja2.environmentfilter
|
| |
+ @jinja2.pass_environment
|
| |
def do_customwordwrap(
|
| |
environment,
|
| |
s,
|
| |
@@ -486,12 +486,20 @@
|
| |
parser = argparse.ArgumentParser(
|
| |
"go2rpm", formatter_class=argparse.RawTextHelpFormatter
|
| |
)
|
| |
- parser.add_argument(
|
| |
+ changelog_group = parser.add_mutually_exclusive_group()
|
| |
+ changelog_group.add_argument(
|
| |
"-r",
|
| |
"--rpmautospec",
|
| |
action="store_true",
|
| |
default=True,
|
| |
- help="Use autorelease and autochangelog features"
|
| |
+ help="Use autorelease and autochangelog features",
|
| |
+ )
|
| |
+ changelog_group.add_argument(
|
| |
+ "-n",
|
| |
+ "--no-rpmautospec",
|
| |
+ action="store_false",
|
| |
+ dest="rpmautospec",
|
| |
+ help="Use static release and changelog instead of rpmautospec.",
|
| |
)
|
| |
parser.add_argument(
|
| |
"--no-auto-changelog-entry",
|
| |
@@ -513,6 +521,14 @@
|
| |
1: legacy macros. 2: current macros. \
|
| |
default: 2",
|
| |
)
|
| |
+ parser.add_argument(
|
| |
+ "-q",
|
| |
+ "--no-spec-warnings",
|
| |
+ dest="spec_warnings",
|
| |
+ action="store_false",
|
| |
+ help="Exclude warning comments from generated specfile. "
|
| |
+ "Currently, this only removes the %%gometa -f explanatory comment.",
|
| |
+ )
|
| |
parser.add_argument("-f", "--forge", action="store", nargs="?", help="Forge URL")
|
| |
parser.add_argument(
|
| |
"-s",
|
| |
@@ -536,10 +552,18 @@
|
| |
parser.add_argument(
|
| |
"-c", "--commit", action="store", nargs="?", help="Package commit"
|
| |
)
|
| |
- parser.add_argument("--dynamic-buildrequires", action="store_true",
|
| |
- help="Use dynamic BuildRequires feature")
|
| |
- parser.add_argument("-R", "--no-dynamic-buildrequires", action="store_true",
|
| |
- help="Do not use dynamic BuildRequires feature")
|
| |
+ dynamic_br_group = parser.add_mutually_exclusive_group()
|
| |
+ dynamic_br_group.add_argument(
|
| |
+ "--dynamic-buildrequires",
|
| |
+ action="store_true",
|
| |
+ help="Use dynamic BuildRequires feature",
|
| |
+ )
|
| |
+ dynamic_br_group.add_argument(
|
| |
+ "-R",
|
| |
+ "--no-dynamic-buildrequires",
|
| |
+ action="store_true",
|
| |
+ help="Do not use dynamic BuildRequires feature",
|
| |
+ )
|
| |
parser.add_argument(
|
| |
"-C",
|
| |
"--clean",
|
| |
@@ -556,7 +580,13 @@
|
| |
goipath = re.sub(r"^http(s?)://", r"", args.goipath)
|
| |
goipath = goipath.strip("/")
|
| |
|
| |
- known_forge = ("github.com", "gitlab.com", "bitbucket.org", "pagure.io", "gitea.com")
|
| |
+ known_forge = (
|
| |
+ "github.com",
|
| |
+ "gitlab.com",
|
| |
+ "bitbucket.org",
|
| |
+ "pagure.io",
|
| |
+ "gitea.com",
|
| |
+ )
|
| |
known_forge_re = r"^(" + r"|".join(re.escape(url) for url in known_forge) + r")"
|
| |
if not re.search(known_forge_re, goipath) and args.forge is None:
|
| |
print(
|
| |
@@ -606,7 +636,9 @@
|
| |
set(buildrequires)
|
| |
)
|
| |
)
|
| |
- test_buildrequires = [ipath for ipath in test_buildrequires if goipath not in ipath]
|
| |
+ test_buildrequires = [
|
| |
+ ipath for ipath in test_buildrequires if goipath not in ipath
|
| |
+ ]
|
| |
else:
|
| |
args.dynamic_buildrequires = True
|
| |
buildrequires = []
|
| |
@@ -663,6 +695,7 @@
|
| |
kwargs["other_cmd"] = other_cmd
|
| |
|
| |
kwargs["rpmautospec"] = args.rpmautospec
|
| |
+ kwargs["spec_warnings"] = args.spec_warnings
|
| |
if args.no_auto_changelog_entry:
|
| |
kwargs["auto_changelog_entry"] = False
|
| |
else:
|
| |
Depends-on: https://pagure.io/go-rpm-macros/pull-request/48