[lxc-devel] [distrobuilder/master] managers: Add --allow-downgrade to zypper

monstermunchkin on Github lxc-bot at linuxcontainers.org
Thu Sep 5 14:26:53 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 499 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190905/4a946ceb/attachment.bin>
-------------- next part --------------
From c91422b24f473847c4130174d699a1310780acd4 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 5 Sep 2019 16:25:04 +0200
Subject: [PATCH] managers: Add --allow-downgrade to zypper

Remove the special case of openSUSE 42.3 and the `--allow-downgrade`
flag. Since openSUSE 42.3 is EOL, we can drop support for it.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 distrobuilder/chroot.go | 5 -----
 managers/zypper.go      | 1 +
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/distrobuilder/chroot.go b/distrobuilder/chroot.go
index 98af837..f24adfc 100644
--- a/distrobuilder/chroot.go
+++ b/distrobuilder/chroot.go
@@ -69,11 +69,6 @@ func managePackages(def shared.DefinitionPackages, actions []shared.DefinitionAc
 		}
 	}
 
-	// TODO: Remove this once openSUSE builds properly without it. OpenSUSE 42.3 doesn't support this flag.
-	if def.Manager == "zypper" && release != "42.3" {
-		manager.SetInstallFlags("install", "--allow-downgrade")
-	}
-
 	var validSets []shared.DefinitionPackagesSet
 
 	for _, set := range def.Sets {
diff --git a/managers/zypper.go b/managers/zypper.go
index 851ae2f..d84759b 100644
--- a/managers/zypper.go
+++ b/managers/zypper.go
@@ -39,6 +39,7 @@ func NewZypper() *Manager {
 			},
 			install: []string{
 				"install",
+				"--allow-downgrade",
 			},
 			remove: []string{
 				"remove",


More information about the lxc-devel mailing list