diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-02-08 14:54:59 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-06-30 09:02:43 +0200 |
commit | cc1ebfd18013c6086881665de55b5ce937aa534e (patch) | |
tree | c07c412c0ec7833aecab6235eb69a564d77250fb /gbp/deb | |
parent | e9d239bb02b0e7bea06c01fb3572330620658209 (diff) | |
download | git-buildpackage-cc1ebfd18013c6086881665de55b5ce937aa534e.tar.gz git-buildpackage-cc1ebfd18013c6086881665de55b5ce937aa534e.tar.bz2 git-buildpackage-cc1ebfd18013c6086881665de55b5ce937aa534e.zip |
PristineTar: move Debian-specific stuff to DebianPristineTar
Continuation to the PristineTar refactoring, makes the "common"
PristineTar independent of DebianPkgPolicy. This commit moves the
Debian-specific has_commit() and checkout() methods to DebianPristineTar
class and replaces them with more generic functions in the base class.
Also, drops the Debian-specific get_commit() method completely, as it
was not used outside the PristineTar class itself.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/deb')
-rw-r--r-- | gbp/deb/pristinetar.py | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/gbp/deb/pristinetar.py b/gbp/deb/pristinetar.py index d7ce75b0..b3cf2373 100644 --- a/gbp/deb/pristinetar.py +++ b/gbp/deb/pristinetar.py @@ -16,8 +16,50 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Handle checkin and checkout of archives from the pristine-tar branch""" +from gbp.pkg import compressor_opts from gbp.pkg.pristinetar import PristineTar +from gbp.deb import DebianPkgPolicy class DebianPristineTar(PristineTar): """The pristine-tar branch in a Debian git repository""" - pass + def has_commit(self, package, version, comp_type=None): + """ + Do we have a pristine-tar commit for package I{package} at version + {version} with compression type I{comp_type}? + + @param package: the package to look for + @type package: C{str} + @param version: the upstream version to look for + @type version: C{str} + @param comp_type: the compression type + @type comp_type: C{str} + """ + if not comp_type: + ext = '\w\+' + else: + ext = compressor_opts[comp_type][1] + + name_regexp = '%s_%s\.orig\.tar\.%s' % (package, version, ext) + + return super(DebianPristineTar, self).has_commit(name_regexp) + + def checkout(self, package, version, comp_type, output_dir): + """ + Checkout the orig tarball for package I{package} of I{version} and + compression type I{comp_type} to I{output_dir} + + @param package: the package to generate the orig tarball for + @type package: C{str} + @param version: the version to check generate the orig tarball for + @type version: C{str} + @param comp_type: the compression type of the tarball + @type comp_type: C{str} + @param output_dir: the directory to put the tarball into + @type output_dir: C{str} + """ + name = DebianPkgPolicy.build_tarball_name(package, + version, + comp_type, + output_dir) + super(DebianPristineTar, self).checkout(name) + |