diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-11-23 18:25:47 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-11-23 18:25:47 +0100 |
commit | 691856db3c97499e07a8ddaf886eb75a17b6046d (patch) | |
tree | 26b5e02358f4f9e5484894ad716c38d2e2662f2e | |
parent | 9478bad09b8e3cf8f58a5324ee1f3e116f6d5214 (diff) |
Use an absolute path when parsing the control file
so we con't accidentally parse a file from another dir.
-rw-r--r-- | gbp/scripts/common/pq.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index ec3f8d7b..cff5bf36 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -108,9 +108,11 @@ def write_patch(patch, patch_dir, options): return dstname -def get_maintainer_from_control(): +def get_maintainer_from_control(repo): """Get the maintainer from the control file""" - cmd = 'sed -n -e \"s/Maintainer: \\+\\(.*\\)/\\1/p\" debian/control' + control = os.path.join(repo.path, 'debian', 'control') + + cmd = 'sed -n -e \"s/Maintainer: \\+\\(.*\\)/\\1/p\" %s' % control cmdout = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.readlines() @@ -156,7 +158,7 @@ def apply_and_commit_patch(repo, patch, topic=None): patch_fn = os.path.basename(patch.path) if not (patch.author and patch.email): - name, email = get_maintainer_from_control() + name, email = get_maintainer_from_control(repo) if name: gbp.log.warn("Patch '%s' has no authorship information, " "using '%s <%s>'" % (patch_fn, name, email)) |