Commit 29b8b036 authored by Guido Günther's avatar Guido Günther

Move debian related helpers into submodule

parent 3e8b3a23
......@@ -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
......
......@@ -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())
......
......@@ -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'],
)
......@@ -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"])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment