From 0f75b262ce6c3d035596793f4ab94363c40dcb71 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Tue, 16 May 2023 03:12:34 +0200 Subject: [PATCH] quote env if it contains whitespace --- utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils.go b/utils.go index f0f6c50..9f58cff 100644 --- a/utils.go +++ b/utils.go @@ -503,6 +503,10 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) { if len(orgMatch) == 0 { // no match found, assume env var and append it log.Debugf("no match found for %s:%v, appending", subSec, subMap) + if strings.Contains(subMap.(string), " ") { + makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap)) + continue + } makepkgConf += fmt.Sprintf("\nexport %s=%s", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap)) continue }