diff options
author | Guido Günther <agx@sigxcpu.org> | 2020-04-17 10:54:06 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2020-04-17 11:39:38 +0200 |
commit | 3b05fa8349d937b005463b4e1344421499a2483f (patch) | |
tree | a1a627ac9bce085bbc0698a41275f77641552b40 | |
parent | e5133756d5024d6f9d0040c3a44c531abd5f3c73 (diff) |
deb: git: Escape '.' on pristine-tar matches
'.' is valid in source package names and version numbers so we
want to match exactly that and not an arbitrary character.
-rw-r--r-- | gbp/deb/git.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gbp/deb/git.py b/gbp/deb/git.py index ee939a85..596c9ff1 100644 --- a/gbp/deb/git.py +++ b/gbp/deb/git.py @@ -311,10 +311,15 @@ class DebianGitRepository(PkgGitRepository): """ Get the pristine-tar commit for the given source package's latest version. """ + def _esc(s): + return s.replace('.', '\\.') + comp = '-%s' % component if component else '' - return self.pristine_tar.get_commit('%s_%s.orig%s.tar.*' % (source.sourcepkg, - source.upstream_version, - comp)) + source_esc = _esc(source.sourcepkg) + ver_esc = _esc(source.upstream_version) + return self.pristine_tar.get_commit('%s_%s\\.orig%s\\.tar.*' % (source_esc, + ver_esc, + comp)) def create_upstream_tarball_via_pristine_tar(self, source, output_dir, comp, upstream_signatures, component=None): output = source.upstream_tarball_name(comp.type, component=component) |