[lxc-devel] [lxc-ci/master] images/gentoo: Fix post-packages action

monstermunchkin on Github lxc-bot at linuxcontainers.org
Mon Aug 3 11:38:58 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 303 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200803/84a130ce/attachment.bin>
-------------- next part --------------
From cc352e3cf065b36c78b71b56cb95f7eed2202355 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Mon, 3 Aug 2020 13:33:20 +0200
Subject: [PATCH] images/gentoo: Fix post-packages action

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 images/gentoo.yaml | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/images/gentoo.yaml b/images/gentoo.yaml
index 1eceadc..76cef86 100644
--- a/images/gentoo.yaml
+++ b/images/gentoo.yaml
@@ -484,10 +484,15 @@ actions:
     #!/bin/sh
     set -eux
 
-    rm /usr/bin/gpg2
-    mv /usr/bin/gpg2.real /usr/bin/gpg2
-    rm /usr/share/portage/config/repos.conf
-    mv /usr/share/portage/config/repos.conf.orig /usr/share/portage/config/repos.conf
+    if [ -f /usr/bin/gpg2.real ]; then
+      rm /usr/bin/gpg2
+      mv /usr/bin/gpg2.real /usr/bin/gpg2
+    fi
+
+    if [ -f /usr/share/portage/config/repos.conf.orig ]; then
+      rm /usr/share/portage/config/repos.conf
+      mv /usr/share/portage/config/repos.conf.orig /usr/share/portage/config/repos.conf
+    fi
   types:
   - container
   - vm


More information about the lxc-devel mailing list