Merge "Revert "Ensure environment dependencies are correct""
am: 411a363c5a
Change-Id: I922c616efe23c5228a69ab24794cc6c32a0fc4cb
This commit is contained in:
@@ -289,7 +289,7 @@ func (c *config) Getenv(key string) string {
|
|||||||
if c.envFrozen {
|
if c.envFrozen {
|
||||||
panic("Cannot access new environment variables after envdeps are frozen")
|
panic("Cannot access new environment variables after envdeps are frozen")
|
||||||
}
|
}
|
||||||
val, _ = originalEnv[key]
|
val = os.Getenv(key)
|
||||||
c.envDeps[key] = val
|
c.envDeps[key] = val
|
||||||
}
|
}
|
||||||
return val
|
return val
|
||||||
|
@@ -15,9 +15,6 @@
|
|||||||
package android
|
package android
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"android/soong/env"
|
"android/soong/env"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
@@ -30,19 +27,6 @@ import (
|
|||||||
// compare the contents of the environment variables, rewriting the file if necessary to cause
|
// compare the contents of the environment variables, rewriting the file if necessary to cause
|
||||||
// a manifest regeneration.
|
// a manifest regeneration.
|
||||||
|
|
||||||
var originalEnv map[string]string
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
originalEnv = make(map[string]string)
|
|
||||||
for _, env := range os.Environ() {
|
|
||||||
idx := strings.IndexRune(env, '=')
|
|
||||||
if idx != -1 {
|
|
||||||
originalEnv[env[:idx]] = env[idx+1:]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
os.Clearenv()
|
|
||||||
}
|
|
||||||
|
|
||||||
func EnvSingleton() blueprint.Singleton {
|
func EnvSingleton() blueprint.Singleton {
|
||||||
return &envSingleton{}
|
return &envSingleton{}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user