DumpENV()

This commit is contained in:
Jeff Carr 2025-09-12 10:12:21 -05:00
parent 5ae5010b00
commit de7b14f3c6
1 changed files with 17 additions and 10 deletions

View File

@ -53,19 +53,22 @@ import (
func ConfigureENV() error {
err := doConfigureENV()
if os.Getenv("FORGE_VERBOSE") == "true" {
log.Printf("fhelp init: FORGE_CONFIG = %s\n", os.Getenv("FORGE_CONFIG"))
log.Printf("fhelp init: FORGE_REPOSDIR = %s\n", os.Getenv("FORGE_REPOSDIR"))
log.Printf("fhelp init: FORGE_REPOSPB = %s\n", os.Getenv("FORGE_REPOSPB"))
log.Printf("fhelp init: FORGE_PATCHDIR = %s\n", os.Getenv("FORGE_PATCHDIR"))
log.Printf("fhelp init: FORGE_URL = %s\n", os.Getenv("FORGE_URL"))
log.Printf("fhelp init: FORGE_GOWORK = %v\n", os.Getenv("FORGE_GOWORK"))
log.Printf("fhelp init: FORGE_VERBOSE = %s\n", os.Getenv("FORGE_VERBOSE"))
log.Printf("fhelp init: HOSTNAME = %s\n", os.Getenv("HOSTNAME"))
os.Exit(-1)
DumpENV("fhelp:")
}
return err
}
func DumpENV(what string) {
log.Printf("%s FORGE_CONFIG = %s\n", what, os.Getenv("FORGE_CONFIG"))
log.Printf("%s FORGE_REPOSDIR = %s\n", what, os.Getenv("FORGE_REPOSDIR"))
log.Printf("%s FORGE_REPOSPB = %s\n", what, os.Getenv("FORGE_REPOSPB"))
log.Printf("%s FORGE_PATCHDIR = %s\n", what, os.Getenv("FORGE_PATCHDIR"))
log.Printf("%s FORGE_URL = %s\n", what, os.Getenv("FORGE_URL"))
log.Printf("%s FORGE_GOWORK = %s\n", what, os.Getenv("FORGE_GOWORK"))
log.Printf("%s FORGE_VERBOSE = %s\n", what, os.Getenv("FORGE_VERBOSE"))
log.Printf("%s HOSTNAME = %s\n", what, os.Getenv("HOSTNAME"))
}
// set the ENV vars
// always set them to _something_ even when everything seems to be failing
func doConfigureENV() error {
@ -104,7 +107,11 @@ func doConfigureENV() error {
}
if os.Getenv("FORGE_PATCHDIR") == "" {
os.Setenv("FORGE_PATCHDIR", os.Getenv("FORGE_REPOSDIR"))
pbdir, err := getCacheDir()
if err != nil {
return err
}
os.Setenv("FORGE_PATCHDIR", pbdir)
}
// setting FORGE_URL