| |
@@ -259,6 +259,9 @@
|
| |
return list(filter(None, (l.strip() for l in s.splitlines())))
|
| |
|
| |
def main():
|
| |
+ default_target = get_default_target()
|
| |
+ default_rpmautospec = default_target in {"fedora"}
|
| |
+
|
| |
parser = argparse.ArgumentParser("rust2rpm",
|
| |
formatter_class=argparse.RawTextHelpFormatter)
|
| |
parser.add_argument("--show-license-map", action="store_true",
|
| |
@@ -270,13 +273,13 @@
|
| |
parser.add_argument("-", "--stdout", action="store_true",
|
| |
help="Print spec and patches into stdout")
|
| |
parser.add_argument("-t", "--target", action="store",
|
| |
- choices=("plain", "fedora", "mageia", "opensuse"), default=get_default_target(),
|
| |
+ choices=("plain", "fedora", "mageia", "opensuse"), default=default_target,
|
| |
help="Distribution target")
|
| |
parser.add_argument("-p", "--patch", action="store_true",
|
| |
help="Do initial patching of Cargo.toml")
|
| |
parser.add_argument("-s", "--store-crate", action="store_true",
|
| |
help="Store crate in current directory")
|
| |
- parser.add_argument("-a", "--rpmautospec", action="store_true", default=False,
|
| |
+ parser.add_argument("-a", "--rpmautospec", action="store_true", default=default_rpmautospec,
|
| |
help="Use autorelease and autochangelog features")
|
| |
parser.add_argument("--all-features", action="store_true",
|
| |
help="Activate all available features")
|
| |
rpmautspec has some shortcomings (e.g. lack of support for multi-line
changelog entries), but those shortcomings are not very important for
rust packages. Let's just use rpmautospec by default for convenience.