diff --git a/clients/crunchbase/ui/build.py b/clients/crunchbase/ui/build.py index f5d2e8451e..e098bf5688 100644 --- a/clients/crunchbase/ui/build.py +++ b/clients/crunchbase/ui/build.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, os.path, subprocess, sys +import os, os.path, subprocess import noms.symlink as symlink diff --git a/tools/noms/staging.py b/tools/noms/staging.py index 2d3b8ca34c..2b3c52d38a 100644 --- a/tools/noms/staging.py +++ b/tools/noms/staging.py @@ -29,8 +29,10 @@ def Main(projectName, stagingFunction): args = parser.parse_args() projectStagingDir = os.path.join(args.stagingDir, projectName) - # check if project dir is in staging dir normalized = os.path.realpath(projectStagingDir) + if not _isSubDir(projectStagingDir, args.stagingDir): + raise Exception(projectStagingDir + ' must be a subdir of ' + args.stagingDir) + os.makedirs(normalized) stagingFunction(normalized) diff --git a/tools/noms/staging_test.py b/tools/noms/staging_test.py index d424437f18..905af7ce55 100644 --- a/tools/noms/staging_test.py +++ b/tools/noms/staging_test.py @@ -24,6 +24,11 @@ class TestStaging(unittest.TestCase): self.assertFalse(staging._isSubDir(self.nested, otherNested)) + def test_DotDotNotReallyNested(self): + notReallyNested = os.path.join(self.tempdir, 'foo', os.pardir, 'bar') + self.assertFalse(staging._isSubDir(self.nested, notReallyNested)) + + def test_LinkNotReallyNested(self): otherNested = tempfile.mkdtemp(dir=self.tempdir) linkName = os.path.join(self.nested, 'link') diff --git a/tools/run_all_build.go b/tools/run_all_build.go index 33e2d6cf21..22af93b322 100644 --- a/tools/run_all_build.go +++ b/tools/run_all_build.go @@ -43,11 +43,8 @@ func main() { } pythonPath := filepath.Join(goPath, nomsCheckoutPath, "tools") env := runner.Env{ - "GOPATH": goPath, - "PYTHONPATH": pythonPath, - "NOMS_SERVER": nomsServer, - "NOMS_CHECKOUT_PATH": filepath.Join(workspace, nomsCheckoutPath), - "ATTIC_CHECKOUT_PATH": filepath.Join(workspace, atticCheckoutPath), + "PYTHONPATH": pythonPath, + "NOMS_SERVER": nomsServer, } if !runner.Serial(os.Stdout, os.Stderr, env, ".", buildScript) { diff --git a/tools/runner/serial.go b/tools/runner/serial.go index 1f3aa4db97..e4337ae953 100644 --- a/tools/runner/serial.go +++ b/tools/runner/serial.go @@ -52,7 +52,7 @@ func Serial(stdout, stderr io.Writer, env Env, dir, filename string, args ...str runErr := runEnvDir(stdout, stderr, env, filepath.Dir(path), "python", scriptAndArgs...) if runErr != nil { success = false - fmt.Fprintf(stderr, "Running %s failed with %v", path, runErr) + fmt.Fprintf(stderr, "Running %s failed with %v\n", path, runErr) } } return nil