summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-11-22 16:49:30 +0100
committerGuido Günther <agx@sigxcpu.org>2011-11-22 16:54:09 +0100
commit29b8b036102f3bb0cb4fa19d66bf8fae274d5537 (patch)
tree6ec14e533f4e20d3450821da4c5583a71265931c
parent3e8b3a23874ddbd9fbf6590be39437f9b846d87a (diff)
downloadgit-buildpackage-29b8b036102f3bb0cb4fa19d66bf8fae274d5537.tar.gz
git-buildpackage-29b8b036102f3bb0cb4fa19d66bf8fae274d5537.tar.bz2
git-buildpackage-29b8b036102f3bb0cb4fa19d66bf8fae274d5537.zip
Move debian related helpers into submodule
-rwxr-xr-xdebian/rules3
-rw-r--r--gbp/deb/__init__.py (renamed from gbp/deb.py)21
-rw-r--r--setup.py4
-rw-r--r--tests/06_test_upstream_source.py4
4 files changed, 17 insertions, 15 deletions
diff --git a/debian/rules b/debian/rules
index bc552320..d416fa41 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,8 @@ override_dh_auto_test:
PYTHONPATH=. \
python setup.py nosetests
- PYTHONPATH=. pychecker $(PYCHECKER_ARGS) -q gbp gbp.scripts gbp.git
+ PYTHONPATH=. pychecker $(PYCHECKER_ARGS) -q \
+ gbp gbp.scripts gbp.git gbp.deb
override_dh_auto_build:
dh_auto_build
diff --git a/gbp/deb.py b/gbp/deb/__init__.py
index e7d1b0e0..881d1ae9 100644
--- a/gbp/deb.py
+++ b/gbp/deb/__init__.py
@@ -23,8 +23,9 @@ import re
import subprocess
import sys
import glob
-import command_wrappers as gbpc
-from errors import GbpError
+
+import gbp.command_wrappers as gbpc
+from gbp.errors import GbpError
from gbp.git import GitRepositoryError
# When trying to parse a version-number from a dsc or changes file, these are
@@ -99,13 +100,13 @@ class DpkgCompareVersions(gbpc.Command):
class UpstreamSource(object):
"""
Upstream source. Can be either an unpacked dir, a tarball or another type
- or archive
+ of archive
@cvar is_dir: are the upstream sources an unpacked dir
@type is_dir: boolean
@cvar _orig: are the upstream sources already suitable as an upstream
tarball
- @type _irog: boolen
+ @type _orig: boolean
@cvar _path: path to the upstream sources
@type _path: string
@cvar _unpacked: path to the unpacked source tree
@@ -179,7 +180,7 @@ class UpstreamSource(object):
raise GbpError, "Unpacking of %s failed" % self.path
def _unpacked_toplevel(self, dir):
- """unpacked archives can contain a leading directory not"""
+ """unpacked archives can contain a leading directory or not"""
unpacked = glob.glob('%s/*' % dir)
unpacked.extend(glob.glob("%s/.*" % dir)) # include hidden files and folders
# Check that dir contains nothing but a single folder:
@@ -241,11 +242,6 @@ class UpstreamSource(object):
Guess the package name and version from the filename of an upstream
archive.
- @param extra_regex: additional regex to apply, needs a 'package' and a
- 'version' group
- @return: (package name, version) or None.
- @rtype: tuple
-
>>> UpstreamSource('foo-bar_0.2.orig.tar.gz').guess_version()
('foo-bar', '0.2')
>>> UpstreamSource('foo-Bar_0.2.orig.tar.gz').guess_version()
@@ -267,6 +263,11 @@ class UpstreamSource(object):
('foo-bar', '0.2')
>>> UpstreamSource('foo-bar_0.2.orig.tar.lzma').guess_version()
('foo-bar', '0.2')
+
+ @param extra_regex: additional regex to apply, needs a 'package' and a
+ 'version' group
+ @return: (package name, version) or None.
+ @rtype: tuple
"""
version_chars = r'[a-zA-Z\d\.\~\-\:\+]'
extensions = r'\.tar\.(%s)' % "|".join(self.known_compressions())
diff --git a/setup.py b/setup.py
index d8676b90..9a0cb590 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@
# END OF COPYRIGHT #
import subprocess
-from setuptools import setup
+from setuptools import setup, find_packages
def fetch_version():
@@ -55,7 +55,7 @@ setup(name = "gbp",
'bin/gbp-clone',
'bin/gbp-create-remote-repo',
'bin/git-pbuilder'],
- packages = [ 'gbp', 'gbp.scripts', 'gbp.git' ],
+ packages = find_packages(),
data_files = [("/etc/git-buildpackage/", ["gbp.conf"]),],
setup_requires=['nose>=1.0', 'coverage>=3.4'],
)
diff --git a/tests/06_test_upstream_source.py b/tests/06_test_upstream_source.py
index 13e0e95f..e414fa43 100644
--- a/tests/06_test_upstream_source.py
+++ b/tests/06_test_upstream_source.py
@@ -49,7 +49,7 @@ class TestTar(unittest.TestCase):
repacked = source.pack(target)
self.assertEqual(repacked.is_orig, True)
self.assertEqual(repacked.is_dir, False)
- self._check_tar(repacked, ["gbp/deb.py", "gbp/__init__.py"])
+ self._check_tar(repacked, ["gbp/errors.py", "gbp/__init__.py"])
def test_pack_filtered(self):
"""Check if filtering out files works"""
@@ -59,7 +59,7 @@ class TestTar(unittest.TestCase):
repacked = source.pack(target, ["__init__.py"])
self.assertEqual(repacked.is_orig, True)
self.assertEqual(repacked.is_dir, False)
- self._check_tar(repacked, ["gbp/deb.py"],
+ self._check_tar(repacked, ["gbp/errors.py"],
["gbp/__init__.py"])