Make zypper dist-upgrade opt-in on SLE/Leap (#417)
Make zypper dist-upgrade opt-in on SLE/Leap
- Create a `suse_dup` config option
- Create a new `Distribution::OpenSuseTumbleweed` object along with `upgrade_opensuse_tumbleweed()`
* The purpose of it is to ignore the config option on Tumblweed as
zypper `dup` is the only way to update a Tumbleweed
This commit is contained in:
@@ -275,6 +275,7 @@ pub struct Linux {
|
||||
apt_arguments: Option<String>,
|
||||
enable_tlmgr: Option<bool>,
|
||||
redhat_distro_sync: Option<bool>,
|
||||
suse_dup: Option<bool>,
|
||||
rpm_ostree: Option<bool>,
|
||||
emerge_sync_flags: Option<String>,
|
||||
emerge_update_flags: Option<String>,
|
||||
@@ -996,6 +997,15 @@ impl Config {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Use zypper dist-upgrade (same as distro-sync on RH) instead of update (default: false on SLE/Leap, ignored on Tumbleweed (dup is always ran))
|
||||
pub fn suse_dup(&self) -> bool {
|
||||
self.config_file
|
||||
.linux
|
||||
.as_ref()
|
||||
.and_then(|linux| linux.suse_dup)
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Use rpm-ostree in *when rpm-ostree is detected* (default: true)
|
||||
pub fn rpm_ostree(&self) -> bool {
|
||||
self.config_file
|
||||
|
||||
Reference in New Issue
Block a user