Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package obs-service-cargo_vendor for openSUSE:Factory checked in at 2021-07-22 22:43:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/obs-service-cargo_vendor (Old) and /work/SRC/openSUSE:Factory/.obs-service-cargo_vendor.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "obs-service-cargo_vendor" Thu Jul 22 22:43:24 2021 rev:3 rq:907607 version:0.4.2~git0.c597055 Changes: -------- --- /work/SRC/openSUSE:Factory/obs-service-cargo_vendor/obs-service-cargo_vendor.changes 2021-03-03 18:35:29.759400707 +0100 +++ /work/SRC/openSUSE:Factory/.obs-service-cargo_vendor.new.1899/obs-service-cargo_vendor.changes 2021-07-22 22:44:07.407140137 +0200 @@ -1,0 +2,14 @@ +Wed Jul 21 04:09:22 UTC 2021 - wbr...@suse.de + +- Update to version 0.4.2~git0.c597055: + * Make cargo vendor quieter + +------------------------------------------------------------------- +Wed Jul 21 03:39:52 UTC 2021 - wbr...@suse.de + +- Update to version 0.4.1~git0.43d1ddd: + * Update README + * Allow cargo update to run before vendoring (#15) + * Cleanup vendor folder after compression (#13) + +------------------------------------------------------------------- Old: ---- obs-service-cargo_vendor-0.4.0~git0.d4f314f.tar.gz New: ---- obs-service-cargo_vendor-0.4.2~git0.c597055.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ obs-service-cargo_vendor.spec ++++++ --- /var/tmp/diff_new_pack.uA6zCG/_old 2021-07-22 22:44:07.883139516 +0200 +++ /var/tmp/diff_new_pack.uA6zCG/_new 2021-07-22 22:44:07.883139516 +0200 @@ -1,5 +1,5 @@ # -# spec file for package obs-service-cargo_vendor +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -22,7 +22,7 @@ License: GPL-2.0-or-later Group: Development/Tools/Building URL: https://github.com/openSUSE/obs-service-%{service} -Version: 0.4.0~git0.d4f314f +Version: 0.4.2~git0.c597055 Release: 0 Source: %{name}-%{version}.tar.gz BuildRequires: python3 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.uA6zCG/_old 2021-07-22 22:44:07.915139474 +0200 +++ /var/tmp/diff_new_pack.uA6zCG/_new 2021-07-22 22:44:07.915139474 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/openSUSE/obs-service-cargo_vendor.git</param> <param name="versionformat">@PARENT_TAG@~git@TAG_OFFSET@.%h</param> <param name="scm">git</param> - <param name="revision">v0.4.0</param> + <param name="revision">v0.4.2</param> <param name="match-tag">v*</param> <param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.uA6zCG/_old 2021-07-22 22:44:07.935139449 +0200 +++ /var/tmp/diff_new_pack.uA6zCG/_new 2021-07-22 22:44:07.935139449 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/openSUSE/obs-service-cargo_vendor.git</param> - <param name="changesrevision">d4f314f99a7253cfe14ec6b5d6c48222466ba576</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">c59705522286cc35cff9570a602184820950a549</param></service></servicedata> \ No newline at end of file ++++++ obs-service-cargo_vendor-0.4.0~git0.d4f314f.tar.gz -> obs-service-cargo_vendor-0.4.2~git0.c597055.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-cargo_vendor-0.4.0~git0.d4f314f/README.md new/obs-service-cargo_vendor-0.4.2~git0.c597055/README.md --- old/obs-service-cargo_vendor-0.4.0~git0.d4f314f/README.md 2020-06-23 10:29:33.000000000 +0200 +++ new/obs-service-cargo_vendor-0.4.2~git0.c597055/README.md 2021-07-21 06:06:12.000000000 +0200 @@ -117,6 +117,11 @@ The compression to use for the `vendor.tar`. If the option is not supplied it will default to `xz`. Available compressions are those supported by `tar`. +- `<param name="update" />` + +If present, cargo update will be run before vendoring to ensure that the latest version of compatible +dependencies is used. + - `<param name="strategy">vendor</param>` The default here is `vendor` which will use `cargo vendor` to fetch the crate dependencies. There @@ -133,6 +138,7 @@ <param name="strategy">vendor</param> <param name="srcdir">projectname</param> <param name="compression">xz</param> + <param name="update" /> </service> </services> ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-cargo_vendor-0.4.0~git0.d4f314f/cargo_vendor new/obs-service-cargo_vendor-0.4.2~git0.c597055/cargo_vendor --- old/obs-service-cargo_vendor-0.4.0~git0.d4f314f/cargo_vendor 2020-06-23 10:29:33.000000000 +0200 +++ new/obs-service-cargo_vendor-0.4.2~git0.c597055/cargo_vendor 2021-07-21 06:06:12.000000000 +0200 @@ -40,12 +40,17 @@ from pathlib import Path from subprocess import check_output from subprocess import CalledProcessError +from subprocess import DEVNULL service_name = "obs-service-cargo_vendor" description = __doc__ -logging.basicConfig(level=logging.DEBUG) +if os.getenv('DEBUG') is not None: + logging.basicConfig(level=logging.DEBUG) +else: + logging.basicConfig(level=logging.INFO) + log = logging.getLogger(service_name) parser = argparse.ArgumentParser( @@ -54,11 +59,13 @@ parser.add_argument("--strategy", default="vendor") parser.add_argument("--srcdir") parser.add_argument("--outdir") +parser.add_argument("--update", default=False, action='store_true') parser.add_argument("--compression", default="xz") args = parser.parse_args() outdir = args.outdir srcdir = args.srcdir +update = args.update compression = args.compression vendor_example = """ @@ -99,26 +106,30 @@ def run_cargo(runDirectory, command, argsList=[]): try: log.info(f"Running cargo {command} in directory: {runDirectory}") - output = check_output(["cargo", command] + argsList, cwd=runDirectory).decode("utf-8").strip() - if output: - log.info(vendor_example) - config_file_path = os.path.join(outdir, "cargo_config") - config_file = open(config_file_path, 'w') - config_file.write(output) - config_file.close() - return True + output = check_output(["cargo", command] + argsList, cwd=runDirectory, stderr=DEVNULL).decode("utf-8").strip() + log.info(f"??? cargo {command} success") + return output except CalledProcessError as e: + log.info(f"??? cargo {command} failed") error = e.output.decode("utf-8").strip() if error: - log.info(error) - return False + log.error(error) + return None def cargo_vendor(appDirectory, argsList=[]): - vendor_dir = os.path.join(appDirectory, "vendor") - log.info(f"Vendoring Cargo.toml deps to {vendor_dir}") - run_cargo(appDirectory, "vendor", argsList + ["--", "vendor"]) - return vendor_dir + if update: + log.info("Updating deps before vendor") + run_cargo(appDirectory, "update") + log.info(f"Vendoring Cargo.toml deps to {appDirectory}/vendor") + output = run_cargo(appDirectory, "vendor", argsList + ["--", "vendor"]) + if output: + log.info(vendor_example) + config_file_path = os.path.join(outdir, "cargo_config") + config_file = open(config_file_path, 'w') + config_file.write(output) + config_file.close() + # End cargo_vendor. def main(): @@ -136,13 +147,30 @@ exit(1) if args.strategy == "vendor": - vendor_dir = cargo_vendor(appDirectory=app_dir) + cargo_vendor(appDirectory=app_dir) + vendor_dir = os.path.join(app_dir, "vendor") + vendor_lock = os.path.join(app_dir, "Cargo.lock") vendor_tarfile = os.path.join(outdir, vendor_tarname) + log.info("Starting compression ...") with tarfile.open(vendor_tarfile, f"w:{compression}") as tar: tar.add(vendor_dir, arcname=("vendor")) + if update: + tar.add(vendor_lock, arcname=("Cargo.lock")) + # Complete, so cleanup the vendor folder. This is needed as obs_scm + compress + # will on subsequent runs, put the vendor folder in the mail tar AND into + # our vendor.tar.xz. + # + # This is not a greater cost, as cargo vendor will always download anyway. + log.debug(f"Cleaning up {vendor_dir} ...") + shutil.rmtree(vendor_dir) + # Remove the updated cargo.lock so that we don't conflict with obs_scm if run again. + if update: + log.debug(f"Cleaning up {vendor_lock} ...") + os.remove(vendor_lock) else: log.error(f"Not a valid strategy : \"{args.strategy}\"") exit(1) + log.info(f"Success") if __name__ == "__main__": ++++++ obs-service-cargo_vendor.obsinfo ++++++ --- /var/tmp/diff_new_pack.uA6zCG/_old 2021-07-22 22:44:07.999139365 +0200 +++ /var/tmp/diff_new_pack.uA6zCG/_new 2021-07-22 22:44:07.999139365 +0200 @@ -1,5 +1,5 @@ name: obs-service-cargo_vendor -version: 0.4.0~git0.d4f314f -mtime: 1592900973 -commit: d4f314f99a7253cfe14ec6b5d6c48222466ba576 +version: 0.4.2~git0.c597055 +mtime: 1626840372 +commit: c59705522286cc35cff9570a602184820950a549