Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mirrorsorcerer for openSUSE:Factory checked in at 2022-03-20 20:55:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mirrorsorcerer (Old) and /work/SRC/openSUSE:Factory/.mirrorsorcerer.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mirrorsorcerer" Sun Mar 20 20:55:24 2022 rev:5 rq:963115 version:0.1.0~11 Changes: -------- --- /work/SRC/openSUSE:Factory/mirrorsorcerer/mirrorsorcerer.changes 2022-03-06 18:15:59.807827802 +0100 +++ /work/SRC/openSUSE:Factory/.mirrorsorcerer.new.25692/mirrorsorcerer.changes 2022-03-20 20:55:36.394531467 +0100 @@ -1,0 +2,7 @@ +Sun Mar 20 03:52:22 UTC 2022 - william.br...@suse.com + +- Update to version 0.1.0~11: + * warn when non-root. Improve daemon mode. Set default pool path + * Fix repo metadata timeout + +------------------------------------------------------------------- Old: ---- mirrorsorcerer-0.1.0~9.tar.xz New: ---- mirrorsorcerer-0.1.0~11.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mirrorsorcerer.spec ++++++ --- /var/tmp/diff_new_pack.6tUX4G/_old 2022-03-20 20:55:37.146532549 +0100 +++ /var/tmp/diff_new_pack.6tUX4G/_new 2022-03-20 20:55:37.150532555 +0100 @@ -17,7 +17,7 @@ Name: mirrorsorcerer -Version: 0.1.0~9 +Version: 0.1.0~11 Release: 0 Summary: Mirror Sorcerer tool to magically make OpenSUSE mirror sources more magic-er License: (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND (MIT OR Unlicense) AND (Apache-2.0 OR Zlib OR MIT) AND BSD-3-Clause AND MIT AND MPL-2.0 ++++++ mirrorsorcerer-0.1.0~9.tar.xz -> mirrorsorcerer-0.1.0~11.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mirrorsorcerer-0.1.0~9/Cargo.toml new/mirrorsorcerer-0.1.0~11/Cargo.toml --- old/mirrorsorcerer-0.1.0~9/Cargo.toml 2022-03-06 06:03:21.000000000 +0100 +++ new/mirrorsorcerer-0.1.0~11/Cargo.toml 2022-03-20 04:44:22.000000000 +0100 @@ -23,6 +23,7 @@ url = { version = "2", features = ["serde"] } surge-ping = "0.4" +users = "0.11" notify = "4.0.17" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mirrorsorcerer-0.1.0~9/mirrorsorcerer.service new/mirrorsorcerer-0.1.0~11/mirrorsorcerer.service --- old/mirrorsorcerer-0.1.0~9/mirrorsorcerer.service 2022-03-06 06:03:21.000000000 +0100 +++ new/mirrorsorcerer-0.1.0~11/mirrorsorcerer.service 2022-03-20 04:44:22.000000000 +0100 @@ -9,7 +9,7 @@ Type=simple User=root Environment=MIRROR_DEFS=/usr/share/mirrorsorcerer/pool.json -ExecStart=/usr/sbin/mirrorsorcerer -x +ExecStart=/usr/sbin/mirrorsorcerer -x -d KillSignal=SIGINT NoNewPrivileges=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mirrorsorcerer-0.1.0~9/src/main.rs new/mirrorsorcerer-0.1.0~11/src/main.rs --- old/mirrorsorcerer-0.1.0~9/src/main.rs 2022-03-06 06:03:21.000000000 +0100 +++ new/mirrorsorcerer-0.1.0~11/src/main.rs 2022-03-20 04:44:22.000000000 +0100 @@ -120,7 +120,8 @@ match zyppconf.section_mut(Some("main")) { Some(sect) => { // Seems wayyy too aggressive, default is 10 - sect.insert("repo.refresh.delay", "15"); + // set to 18 hours, should allow once-a-day refresh + sect.insert("repo.refresh.delay", "1080"); // Prevent chunking which tanks performance. sect.insert("download.max_concurrent_connections", "1"); // This is a foot-nuclear-rpg-gun. @@ -230,9 +231,9 @@ #[structopt(short = "x")] /// Do it - profile mirrors and update repos. Without this, a dry-run is performed. doit: bool, - #[structopt(short = "1")] - /// One shot - don't persist and watch the repo directory. Useful in container pipelines. - oneshot: bool, + #[structopt(short = "d")] + /// Daemon mode - persist and watch the repo directory. Useful in servers/systems. + daemon: bool, } #[tokio::main(flavor = "current_thread")] @@ -254,19 +255,25 @@ let config = Config::from_args(); - let md: MirrorDefinitions = match config.mirror_definitions.and_then(|p| { - fs::File::open(&p) - .map_err(|e| { - warn!(?e, ?p, "Unable to open"); - }) - .ok() - .map(BufReader::new) - .and_then(|rdr| { - serde_json::from_reader(rdr) - .map_err(|e| warn!(?e, ?p, "Unable to parse")) - .ok() - }) - }) { + let mirror_def_path = config.mirror_definitions.unwrap_or_else(|| { + PathBuf::from(if cfg!(debug_assertions) { + "./pool.json" + } else { + "/usr/share/mirrorsorcerer/pool.json" + }) + }); + + let md: MirrorDefinitions = match fs::File::open(&mirror_def_path) + .map_err(|e| { + warn!(?e, ?mirror_def_path, "Unable to open"); + }) + .ok() + .map(BufReader::new) + .and_then(|rdr| { + serde_json::from_reader(rdr) + .map_err(|e| warn!(?e, ?mirror_def_path, "Unable to parse")) + .ok() + }) { Some(l) => l, None => { error!("Unable to access mirror pool list, refusing to proceed"); @@ -313,6 +320,12 @@ return; } + if users::get_effective_uid() != 0 { + info!("not running as root, not changing /etc/zypp/repos.d"); + info!("To update your mirrors re-run with 'sudo'"); + return; + } + // Update zypper config to select non-shit options. There are // some really unsafe and slow options that it chooses ... rewrite_zyppconf(); @@ -341,7 +354,7 @@ rewrite_mirror(p, &m, &known_m); }); - if config.oneshot { + if !config.daemon { return; } ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/mirrorsorcerer/vendor.tar.xz /work/SRC/openSUSE:Factory/.mirrorsorcerer.new.25692/vendor.tar.xz differ: char 27, line 1