[lxc-devel] [distrobuilder/master] Fix wiping of cache

stgraber on Github lxc-bot at linuxcontainers.org
Sat Jul 27 23:22:52 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 363 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190727/64f1452f/attachment.bin>
-------------- next part --------------
From a6d6334999efe905f05c90b0f9661eff818a3d30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 27 Jul 2019 19:22:33 -0400
Subject: [PATCH] Fix wiping of cache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 distrobuilder/main.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/distrobuilder/main.go b/distrobuilder/main.go
index 2761737..2cb49d5 100644
--- a/distrobuilder/main.go
+++ b/distrobuilder/main.go
@@ -157,6 +157,7 @@ func (c *cmdGlobal) preRunBuild(cmd *cobra.Command, args []string) error {
 
 	// Clean up cache directory before doing anything
 	os.RemoveAll(c.flagCacheDir)
+	os.Mkdir(c.flagCacheDir, 0755)
 
 	if len(args) > 1 {
 		// Create and set target directory if provided
@@ -252,6 +253,7 @@ func (c *cmdGlobal) preRunPack(cmd *cobra.Command, args []string) error {
 
 	// Clean up cache directory before doing anything
 	os.RemoveAll(c.flagCacheDir)
+	os.Mkdir(c.flagCacheDir, 0755)
 
 	// resolve path
 	c.sourceDir, err = filepath.Abs(args[1])


More information about the lxc-devel mailing list