[lxc-devel] [distrobuilder/master] sources: Fix openSUSE --allow-downgrade flag

monstermunchkin on Github lxc-bot at linuxcontainers.org
Wed Mar 6 19:31:16 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190306/3855fb52/attachment.bin>
-------------- next part --------------
From 791da4d139d300e4a96b897dc3adc454cb6d876a Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Wed, 6 Mar 2019 20:30:37 +0100
Subject: [PATCH] sources: Fix openSUSE --allow-downgrade flag

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 distrobuilder/chroot.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/distrobuilder/chroot.go b/distrobuilder/chroot.go
index 342db01..61d502e 100644
--- a/distrobuilder/chroot.go
+++ b/distrobuilder/chroot.go
@@ -52,6 +52,11 @@ 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 release != "42.3" {
+		manager.SetInstallFlags("install", "--allow-downgrade")
+	}
+
 	for _, set := range def.Sets {
 		if len(set.Releases) > 0 && !lxd.StringInSlice(release, set.Releases) {
 			continue
@@ -71,11 +76,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 release != "42.3" {
-		manager.SetInstallFlags("install", "--allow-downgrade")
-	}
-
 	if def.Cleanup {
 		err = manager.Clean()
 		if err != nil {


More information about the lxc-devel mailing list