From de7b14f3c6cf56baf24a7d66df785dd595d4f85a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 12 Sep 2025 10:12:21 -0500 Subject: [PATCH] DumpENV() --- configureENV.go | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/configureENV.go b/configureENV.go index 156ed43..5b3d51a 100644 --- a/configureENV.go +++ b/configureENV.go @@ -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