Add --prep-only option to run preparatory work only

For non-autospec enabled packages this option can be used to download
the upstream tarball, any specified archives, extract them and put the
archives at their destination, and update the upstream file, but not
actually attempt to build a specfile.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
Matthew Johnson
2017-10-19 17:07:51 -07:00
parent 32aa9c70ff
commit a2967f2ea2
+17 -2
View File
@@ -153,6 +153,9 @@ def main():
default=False,
help="Search for package signature from source URL and "
"attempt to verify package")
parser.add_argument("-p", "--prep-only", action="store_true",
default=False,
help="Only perform preparatory work on package")
parser.add_argument("--non_interactive", action="store_true",
default=False,
help="Disable interactive mode for package verification")
@@ -175,6 +178,14 @@ def main():
"-a/--archives or options.conf['package']['archives'] requires an "
"even number of arguments"))
if args.prep_only:
package(args, url, name, archives, "./workingdir")
else:
with tempfile.TemporaryDirectory() as workingdir:
package(args, url, name, archives, workingdir)
def package(args, url, name, archives, workingdir):
check_requirements(args.git)
build.setup_workingdir(workingdir)
@@ -186,6 +197,11 @@ def main():
tarball.process(url, name, args.version, args.target, archives, filemanager)
_dir = tarball.path
if args.prep_only:
print("Exiting after prep due to --prep-only flag")
print("Results under './workingdir'")
exit(0)
if args.license_only:
try:
with open(os.path.join(build.download_path,
@@ -268,5 +284,4 @@ def main():
if __name__ == '__main__':
with tempfile.TemporaryDirectory() as workingdir:
main()
main()