| |
@@ -37,15 +37,14 @@
|
| |
extensions=["jinja2.ext.do"],
|
| |
trim_blocks=True,
|
| |
lstrip_blocks=True)
|
| |
- LICENSES = re.compile(
|
| |
- r"(COPYING|COPYING[\.\-].*|COPYRIGHT|COPYRIGHT[\.\-].*|"
|
| |
- r"EULA|EULA[\.\-].*|[Ll]icen[cs]e|[Ll]icen[cs]e.*|LICEN[CS]E|"
|
| |
- r"LICEN[CS]E[\.\-].*|.*[\.\-]LICEN[CS]E.*|NOTICE|NOTICE[\.\-].*|"
|
| |
- r"PATENTS|PATENTS[\.\-].*|UNLICEN[CS]E|UNLICEN[CS]E[\.\-].*|"
|
| |
- r"agpl[\.\-].*|gpl[\.\-].*|lgpl[\.\-].*|AGPL-.*[0-9].*|"
|
| |
- r"APACHE-.*[0-9].*|BSD-.*[0-9].*|CC-BY-.*|GFDL-.*[0-9].*|"
|
| |
- r"GNU-.*[0-9].*|GPL-.*[0-9].*|LGPL-.*[0-9].*|MIT-.*[0-9].*|"
|
| |
- r"MPL-.*[0-9].*|OFL-.*[0-9].*)")
|
| |
+ LICENSES = re.compile(r"""
|
| |
+ COPYING(?:[.-].*)?|COPYRIGHT(?:[.-].*)?|
|
| |
+ EULA(?:[.-].*)?|[Ll]icen[cs]e|[Ll]icen[cs]e.*|
|
| |
+ (?:.*[.-])?(?:UN)?LICEN[CS]E(?:[.-].*)?|NOTICE(?:[.-].*)?|
|
| |
+ PATENTS(?:[.-].*)?|
|
| |
+ (?:agpl|l?gpl)[.-].*|CC-BY-.*|
|
| |
+ (?:AGPL|APACHE|BSD|GFDL|GNU|L?GPL|MIT|MPL|OFL)-.*[0-9].*
|
| |
+ """, re.VERBOSE)
|
| |
|
| |
def sortify(func):
|
| |
"""Return a sorted list from a generator"""
|
| |
@@ -236,16 +235,18 @@
|
| |
|
| |
@sortify
|
| |
def get_doc_files(path):
|
| |
- matcher = re.compile(
|
| |
- r"(.*\.md|.*\.markdown|.*\.mdown|.*\.mkdn|.*\.rst|.*\.txt|AUTHORS|"
|
| |
- r"AUTHORS[\.\-].*|CONTRIBUTORS|CONTRIBUTORS[\.\-].*|README|"
|
| |
- r"README[\.\-].*|CHANGELOG|CHANGELOG[\.\-].*|TODO|TODO[\.\-].*)",
|
| |
- re.IGNORECASE)
|
| |
- matcherex = re.compile(r"CMakeLists\.txt")
|
| |
+ plus = re.compile(r"""
|
| |
+ .*\.(?:md|markdown|mdown|mkdn|rst|txt)|AUTHORS|
|
| |
+ AUTHORS[.-].*|CONTRIBUTORS|CONTRIBUTORS[.-].*|README|
|
| |
+ README[.-].*|CHANGELOG|CHANGELOG[.-].*|TODO|TODO[.-].*
|
| |
+ """,
|
| |
+ re.IGNORECASE | re.VERBOSE)
|
| |
+ minus = re.compile(r"CMakeLists\.txt|.*\.tpl|.*\.in")
|
| |
+
|
| |
for root, dirs, files in os.walk(path, topdown=True):
|
| |
dirs[:] = []
|
| |
for f in files:
|
| |
- if matcher.match(f) and not LICENSES.match(f) and not matcherex.match(f):
|
| |
+ if plus.fullmatch(f) and not LICENSES.fullmatch(f) and not minus.fullmatch(f):
|
| |
yield os.path.relpath(os.path.join(root, f), path)
|
| |
|
| |
def get_package_info(package):
|
| |
@@ -357,6 +358,8 @@
|
| |
help="Store crate in current directory")
|
| |
parser.add_argument("-a", "--rpmautospec", action="store_true",
|
| |
help="Use autorelease and autochangelog features")
|
| |
+ parser.add_argument("--no-rpmautospec", action="store_false",
|
| |
+ help="Do not use rpmautospec")
|
| |
parser.add_argument("--all-features", action="store_true",
|
| |
help="Activate all available features")
|
| |
parser.add_argument("--dynamic-buildrequires", action="store_true",
|
| |
@@ -436,7 +439,9 @@
|
| |
|
| |
kwargs["auto_changelog_entry"] = not args.no_auto_changelog_entry
|
| |
|
| |
- rpmautospec = args.rpmautospec or detect_rpmautospec(default_target, spec_file)
|
| |
+ rpmautospec = args.rpmautospec
|
| |
+ if args.rpmautospec is None:
|
| |
+ rpmautospec = detect_rpmautospec(default_target, spec_file)
|
| |
kwargs["rpmautospec"] = rpmautospec
|
| |
|
| |
if args.target in {"fedora", "mageia", "opensuse"}:
|
| |
Does this actually take into account the new flag?
I think you need to either actually read the
args.no_rpmautospec
value somewhere, or make the flag use the samedest
(if that works?)