summaryrefslogtreecommitdiff
path: root/gbp/scripts/pq_rpm.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-12-01 11:36:52 +0200
committerTzafrir Cohen <tzafrir@debian.org>2015-03-26 14:21:52 +0200
commit320db0d24a3884c704b7d0d7c1356b5d704dcfb6 (patch)
treea046924e30ee20e4124f491b9949ed75b02f3438 /gbp/scripts/pq_rpm.py
parente4e3cb905c99d2b021c8fb6028e9ef92cd8d57ab (diff)
pq: allow running actions in repo subdir
This should make the usage of gbp-pq more flexible and prevent mistakes caused by e.g. running gbp-pq import under some subdirectory. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts/pq_rpm.py')
-rwxr-xr-xgbp/scripts/pq_rpm.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py
index 764ccff..3c22ccb 100755
--- a/gbp/scripts/pq_rpm.py
+++ b/gbp/scripts/pq_rpm.py
@@ -429,6 +429,10 @@ def main(argv):
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
+ if os.path.abspath('.') != repo.path:
+ gbp.log.warn("Switching to topdir before running commands")
+ os.chdir(repo.path)
+
try:
# Create base temporary directory for this run
options.tmp_dir = tempfile.mkdtemp(dir=options.tmp_dir,