diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-11-19 18:48:56 +0100 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-11-19 18:48:56 +0100 |
commit | a12974b7f5c1d26989ea7b777602b0a1a82224bd (patch) | |
tree | ec9321389162d009f23714c43171a976d97804dc | |
parent | 124a9663ddbbcde0e6ec98e0238fe9d7096ec01f (diff) | |
download | git-buildpackage-a12974b7f5c1d26989ea7b777602b0a1a82224bd.tar.gz git-buildpackage-a12974b7f5c1d26989ea7b777602b0a1a82224bd.tar.bz2 git-buildpackage-a12974b7f5c1d26989ea7b777602b0a1a82224bd.zip |
make sure we don't switch directories during build (Closes: #451550)
-rwxr-xr-x | git-buildpackage | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/git-buildpackage b/git-buildpackage index 036d9f8d..5d037cd3 100755 --- a/git-buildpackage +++ b/git-buildpackage @@ -25,7 +25,7 @@ import pipes import time from gbp.git_utils import (GitRepositoryError, GitRepository, build_tag) from gbp.deb_utils import (parse_changelog, is_native, orig_file, has_orig, copy_orig) -from gbp.command_wrappers import (GitTag, Command, CommandExecFailed, RemoveTree) +from gbp.command_wrappers import (GitTag, Command, RunAtCommand, CommandExecFailed, RemoveTree) from gbp.config import GbpOptionParser from gbp.errors import GbpError @@ -215,9 +215,11 @@ def main(argv): raise GbpError, "Cannot create upstream tarball at '%s'" % output_dir if options.export_dir: - os.chdir(export_dir) + build_dir = export_dir + else: + build_dir = repo_dir - Command(options.builder, dpkg_args, shell=True)() + RunAtCommand(options.builder, dpkg_args, shell=True)(dir=build_dir) if options.tag: try: version = cp['Version'] @@ -240,7 +242,6 @@ def main(argv): if options.export_dir and not retval: RemoveTree(export_dir)() - os.chdir(repo_dir) return retval if __name__ == '__main__': |