quote env if it contains whitespace

This commit is contained in:
2023-05-16 03:12:34 +02:00
parent 57acc40a56
commit 0f75b262ce

View File

@@ -503,6 +503,10 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
if len(orgMatch) == 0 { if len(orgMatch) == 0 {
// no match found, assume env var and append it // no match found, assume env var and append it
log.Debugf("no match found for %s:%v, appending", subSec, subMap) 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)) makepkgConf += fmt.Sprintf("\nexport %s=%s", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
continue continue
} }