Skip to content
Snippets Groups Projects
Commit 1bc98e60 authored by Piotr Ożarowski's avatar Piotr Ożarowski
Browse files

add check_versions target

parent 7caae672
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/make -f
INSTALL ?= install
PREFIX ?= /usr
PREFIX ?= /usr/local
clean:
make -C tests clean
......@@ -34,4 +34,15 @@ tests: nose
test%:
make -C tests $@
.PHONY: clean tests test%
check_versions:
@PYTHONPATH=. set -e; \
DEFAULT=`python -c 'import debpython.version as v; print v.vrepr(v.DEFAULT)'`;\
SUPPORTED=`python -c 'import debpython.version as v; print " ".join(sorted(v.vrepr(v.SUPPORTED)))'`;\
DEB_DEFAULT=`sed -rn 's,^default-version = python([0.9.]*),\1,p' debian/debian_defaults`;\
DEB_SUPPORTED=`sed -rn 's|^supported-versions = (.*)|\1|p' debian/debian_defaults | sed 's/python//g;s/,//g'`;\
[ "$$DEFAULT" = "$$DEB_DEFAULT" ] || \
(echo 'Please update DEFAULT in debpython/version.py' >/dev/stderr; false);\
[ "$$SUPPORTED" = "$$DEB_SUPPORTED" ] || \
(echo 'Please update SUPPORTED in debpython/version.py' >/dev/stderr; false)
.PHONY: clean tests test% check_versions
python-defaults (2.6.5-6) UNRELEASED; urgency=low
python-defaults (2.6.5-6) unstable; urgency=low
[ Piotr Ożarowski ]
* dh_python2:
......@@ -11,13 +11,13 @@ python-defaults (2.6.5-6) UNRELEASED; urgency=low
[ Scott Kitterman ]
* Merge changes back from Ubuntu package:
- Tighten ${binary:Version} depends relationships to "="
- python: Add an unversioned `2to3' binary (Change pending in Debian)
- python: Add an unversioned `2to3' binary
- python-minimal: Provide symlink to binary and manpage for
/usr/bin/python2 (Closes: #566266)
* Update hard coded fallbacks in debian/pyversions.py to add python2.6 to
supported versions and to make it the default version
-- Scott Kitterman <scott@kitterman.com> Sun, 27 Jun 2010 14:53:31 -0400
-- Piotr Ożarowski <piotr@debian.org> Sun, 11 Jul 2010 14:28:47 +0200
python-defaults (2.6.5-5) unstable; urgency=medium
......
......@@ -16,7 +16,7 @@ Depends: ${misc:Depends}, python2.6 (>= 2.6.5+20100616-1~), python-minimal (= ${
Conflicts: python2.3 (<< 2.3.5-14), python2.1 (<= 2.1.2), python-xmlbase, python-csv, python-bz2, python-base, python-central (<< 0.5.5)
Replaces: python2.3 (<= 2.3.2-6), python-xmlbase, python-base, python-dev (<< 2.6.5-2)
Provides: python-email, python-xmlbase, python-plistlib, python-ctypes, python-wsgiref
Suggests: python-doc (>= ${binary:Version}), python-tk (>= ${binary:Version}), python-profiler (>= ${binary:Version})
Suggests: python-doc (= ${binary:Version}), python-tk (= ${binary:Version}), python-profiler (= ${binary:Version})
Description: An interactive high-level object-oriented language (default version)
Python, the high-level, interactive object oriented language,
includes an extensive class library with lots of goodies for
......
......@@ -142,8 +142,9 @@ stamp-dh_python:
dh_testdir
dh_testroot
dh_installdirs
DESTDIR=debian/python make install-dev
DESTDIR=debian/python-minimal make install-runtime
make check_versions
DESTDIR=debian/python PREFIX=/usr make install-dev
DESTDIR=debian/python-minimal PREFIX=/usr make install-runtime
touch $@
# Build architecture-independent files here.
......
......@@ -19,7 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from __future__ import with_statement
import logging
from debpython.pydist import parse_pydep
from debpython.version import SUPPORTED, DEFAULT, debsorted, vrepr, vrange_str
......@@ -102,7 +101,7 @@ class Dependencies(object):
tpl2 = 'python%d.%d'
self.depend(' | '.join(tpl2 % i for i in debsorted(pub_vers)))
# add additional Breaks/Depends to block python package transitions
# additional Breaks/Depends to block python package transitions
if self.use_breaks:
if minv <= min_supp:
self.break_("%s (<< %d.%d)" % \
......@@ -129,7 +128,7 @@ class Dependencies(object):
versions = list(v for i, v in details.get('shebangs', []) if v)
if len(versions) > 1:
log.error('more than one Python dependency from shebangs'
'(%s shebang versions: %s', private_dir, versions)
'(%s shebang versions: %s)', private_dir, versions)
exit(13)
elif len(versions) == 1: # one hardcoded version
self.depend("python%d.%d" % versions[0])
......
......@@ -48,7 +48,7 @@ REQUIRES_RE = re.compile(r'''
(?P<name>[A-Za-z][A-Za-z0-9_.]*)
\s*
(?: # optional version
(?P<symbol><=?|>=?|==|!=)
(?P<operator><=?|>=?|==|!=)
\s*
(?P<version>(\w|[-.])+)
)?
......@@ -110,8 +110,8 @@ def guess_dependency(req, version=None):
req_dict = REQUIRES_RE.match(req)
if not req:
log.warning('requirement is not valid: %s', req)
log.debug('please ask dh_python2 author to fix REQUIRES_RE '
'or your upstream author to fix requires.txt')
log.info('please ask dh_python2 author to fix REQUIRES_RE '
'or your upstream author to fix requires.txt')
return set() # should we sys.exit(1) here?
req_dict = req_dict.groupdict()
name = req_dict['name'].lower()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment