Skip to content
Snippets Groups Projects
Commit 981c4ab0 authored by Matthias Klose's avatar Matthias Klose
Browse files

package version python-defaults-2.4.3-6

parent e0acddff
No related branches found
No related tags found
No related merge requests found
python-defaults (2.4.3-6) experimental; urgency=low
* Remove python's dependency on python-central. Closes: #372658.
* On upgrade of the runtime to a new major version, call the hooks
(executable files) in /usr/share/python/runtime.d/*.rtupdate.
- in python.preinst, call the script with parameters
pre-rtupdate <old runtime> <new runtime>.
run all hooks, then return exit with the correct exit status.
- in python.postinst, call the script with parameters
rtupdate <old runtime> <new runtime>.
run all hooks, then return exit with the correct exit status.
- in python.postinst, call the script with parameters
post-rtupdate <old runtime> <new runtime>.
run all hooks, then return exit with the correct exit status.
* pyversions -r: If the XS-Python-Version field cannot be found in
debian/control, fall back to debian/pyversions for the version
information. Return with an error code, if the intersection of
the versions in debian/pyversions and the supported python versions
is empty. Fall back to the supported versions if no version
information can be found. Based on a patch from Raphael Hertzog.
* Reflect renaming of the docutils binaries. Closes: #377601.
-- Matthias Klose <doko@debian.org> Sat, 5 Aug 2006 17:54:43 +0200
python-defaults (2.4.3-5) experimental; urgency=low python-defaults (2.4.3-5) experimental; urgency=low
* Tighten dependencies between packages built from this source. * Tighten dependencies between packages built from this source.
......
...@@ -2,14 +2,15 @@ Source: python-defaults ...@@ -2,14 +2,15 @@ Source: python-defaults
Section: python Section: python
Priority: optional Priority: optional
Maintainer: Matthias Klose <doko@debian.org> Maintainer: Matthias Klose <doko@debian.org>
Build-Depends-Indep: debhelper (>= 4), libhtml-tree-perl, debiandoc-sgml, python-docutils, python, python2.4 Build-Depends-Indep: debhelper (>= 4), libhtml-tree-perl, debiandoc-sgml, python-docutils (>= 0.4-3), python
Standards-Version: 3.7.2 Standards-Version: 3.7.2
Package: python Package: python
Architecture: all Architecture: all
Priority: standard Priority: standard
Pre-Depends: python-minimal (>= 2.4)
Depends: python2.4 (>= 2.4.3-7), python-minimal (= ${Source-Version}) Depends: python2.4 (>= 2.4.3-7), python-minimal (= ${Source-Version})
Conflicts: python2.3 (<< 2.3.5-14), python2.1 (<= 2.1.2), python-xmlbase, python-csv, python-bz2, python-base, python-central (<< 0.4.17) Conflicts: python2.3 (<< 2.3.5-14), python2.1 (<= 2.1.2), python-xmlbase, python-csv, python-bz2, python-base, python-central (<< 0.5.3)
Replaces: python2.3 (<= 2.3.2-6), python-xmlbase, python-base Replaces: python2.3 (<= 2.3.2-6), python-xmlbase, python-base
Provides: python-email, python-xmlbase Provides: python-email, python-xmlbase
Suggests: python-doc, python-tk, python-profiler Suggests: python-doc, python-tk, python-profiler
...@@ -24,8 +25,8 @@ Description: An interactive high-level object-oriented language (default version ...@@ -24,8 +25,8 @@ Description: An interactive high-level object-oriented language (default version
Package: python-minimal Package: python-minimal
Architecture: all Architecture: all
Priority: standard Priority: standard
Depends: python2.4-minimal (>= 2.4.3-7), python-central (>= 0.4.11), dpkg (>= 1.13.20) Depends: python2.4-minimal (>= 2.4.3-7), dpkg (>= 1.13.20)
Conflicts: python (<= 2.4-1), python-central (<< 0.4.8) Conflicts: python (<= 2.4-1), python-central (<< 0.5)
Replaces: python (<= 2.4-1) Replaces: python (<= 2.4-1)
Description: A minimal subset of the Python language (default version) Description: A minimal subset of the Python language (default version)
This package contains the interpreter and some essential modules. It's used This package contains the interpreter and some essential modules. It's used
...@@ -35,7 +36,7 @@ Description: A minimal subset of the Python language (default version) ...@@ -35,7 +36,7 @@ Description: A minimal subset of the Python language (default version)
Package: python-examples Package: python-examples
Architecture: all Architecture: all
Depends: python (= ${Source-Version}), python (<< 2.5), python2.4-examples (>= 2.4.3-7) Depends: python (= ${Source-Version}), python2.4-examples (>= 2.4.3-7)
Description: Examples for the Python language (default version) Description: Examples for the Python language (default version)
Examples, Demos and Tools for Python. These are files included in Examples, Demos and Tools for Python. These are files included in
the upstream Python distribution. the upstream Python distribution.
...@@ -60,6 +61,7 @@ Description: Header files and a static library for Python (default) ...@@ -60,6 +61,7 @@ Description: Header files and a static library for Python (default)
Package: idle Package: idle
Architecture: all Architecture: all
Depends: python (= ${Source-Version}), idle-python2.4 (>= 2.4.3-7) Depends: python (= ${Source-Version}), idle-python2.4 (>= 2.4.3-7)
Enhances: python
Description: An IDE for Python using Tkinter (default version) Description: An IDE for Python using Tkinter (default version)
IDLE is an Integrated Development Environment for Python. IDLE is an Integrated Development Environment for Python.
IDLE is written using Tkinter and therefore quite platform-independent. IDLE is written using Tkinter and therefore quite platform-independent.
......
...@@ -2,14 +2,15 @@ Source: python-defaults ...@@ -2,14 +2,15 @@ Source: python-defaults
Section: python Section: python
Priority: optional Priority: optional
Maintainer: Matthias Klose <doko@debian.org> Maintainer: Matthias Klose <doko@debian.org>
Build-Depends-Indep: debhelper (>= 4), libhtml-tree-perl, debiandoc-sgml, python-docutils, python, python2.4 Build-Depends-Indep: debhelper (>= 4), libhtml-tree-perl, debiandoc-sgml, python-docutils (>= 0.4-3), python
Standards-Version: 3.7.2 Standards-Version: 3.7.2
Package: python Package: python
Architecture: all Architecture: all
Priority: standard Priority: standard
Pre-Depends: python-minimal (>= 2.4)
Depends: @PVER@ (>= @PREVVER@), python-minimal (= ${Source-Version}) Depends: @PVER@ (>= @PREVVER@), python-minimal (= ${Source-Version})
Conflicts: python2.3 (<< 2.3.5-14), python2.1 (<= 2.1.2), python-xmlbase, python-csv, python-bz2, python-base, python-central (<< 0.4.17) Conflicts: python2.3 (<< 2.3.5-14), python2.1 (<= 2.1.2), python-xmlbase, python-csv, python-bz2, python-base, python-central (<< 0.5.3)
Replaces: python2.3 (<= 2.3.2-6), python-xmlbase, python-base Replaces: python2.3 (<= 2.3.2-6), python-xmlbase, python-base
Provides: python-email, python-xmlbase Provides: python-email, python-xmlbase
Suggests: python-doc, python-tk, python-profiler Suggests: python-doc, python-tk, python-profiler
...@@ -24,8 +25,8 @@ Description: An interactive high-level object-oriented language (default version ...@@ -24,8 +25,8 @@ Description: An interactive high-level object-oriented language (default version
Package: python-minimal Package: python-minimal
Architecture: all Architecture: all
Priority: standard Priority: standard
Depends: @PVER@-minimal (>= @PREVVER@), python-central (>= 0.4.11), dpkg (>= 1.13.20) Depends: @PVER@-minimal (>= @PREVVER@), dpkg (>= 1.13.20)
Conflicts: python (<= 2.4-1), python-central (<< 0.4.8) Conflicts: python (<= 2.4-1), python-central (<< 0.5)
Replaces: python (<= 2.4-1) Replaces: python (<= 2.4-1)
Description: A minimal subset of the Python language (default version) Description: A minimal subset of the Python language (default version)
This package contains the interpreter and some essential modules. It's used This package contains the interpreter and some essential modules. It's used
...@@ -35,7 +36,7 @@ Description: A minimal subset of the Python language (default version) ...@@ -35,7 +36,7 @@ Description: A minimal subset of the Python language (default version)
Package: python-examples Package: python-examples
Architecture: all Architecture: all
Depends: python (= ${Source-Version}), python (<< @NVER@), @PVER@-examples (>= @PREVVER@) Depends: python (= ${Source-Version}), @PVER@-examples (>= @PREVVER@)
Description: Examples for the Python language (default version) Description: Examples for the Python language (default version)
Examples, Demos and Tools for Python. These are files included in Examples, Demos and Tools for Python. These are files included in
the upstream Python distribution. the upstream Python distribution.
...@@ -60,6 +61,7 @@ Description: Header files and a static library for Python (default) ...@@ -60,6 +61,7 @@ Description: Header files and a static library for Python (default)
Package: idle Package: idle
Architecture: all Architecture: all
Depends: python (= ${Source-Version}), idle-@PVER@ (>= @PREVVER@) Depends: python (= ${Source-Version}), idle-@PVER@ (>= @PREVVER@)
Enhances: python
Description: An IDE for Python using Tkinter (default version) Description: An IDE for Python using Tkinter (default version)
IDLE is an Integrated Development Environment for Python. IDLE is an Integrated Development Environment for Python.
IDLE is written using Tkinter and therefore quite platform-independent. IDLE is written using Tkinter and therefore quite platform-independent.
......
...@@ -16,7 +16,31 @@ case "$1" in ...@@ -16,7 +16,31 @@ case "$1" in
if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4; then if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4; then
oldv=$(echo $2 | sed 's/^\(...\).*/\1/') oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
pycentral updatedefault python$oldv python2.4 if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python rtupdate hooks for @PVER@..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook rtupdate python$oldv @PVER@; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 4
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python post-rtupdate hooks for @PVER@..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook post-rtupdate python$oldv @PVER@; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python post-rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 5
fi fi
esac esac
......
File moved
#! /bin/sh -e
[ -L /usr/share/doc/python/html ] || rm -rf /usr/share/doc/python/html
#DEBHELPER#
...@@ -7,4 +7,23 @@ update-alternatives --remove python /usr/bin/python1.5 || true ...@@ -7,4 +7,23 @@ update-alternatives --remove python /usr/bin/python1.5 || true
update-alternatives --remove python /usr/bin/python2.1 || true update-alternatives --remove python /usr/bin/python2.1 || true
update-alternatives --remove python /usr/bin/python2.2 || true update-alternatives --remove python /usr/bin/python2.2 || true
[ -L /usr/share/doc/python/html ] || rm -rf /usr/share/doc/python/html
case "$1" in
upgrade)
if dpkg --compare-versions $2 lt 2.4; then
oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
echo "running python pre-rtupdate hooks for @PVER@..."
fi
for hook in /usr/share/python/runtime.d/*.rtupdate; do
[ -x $hook ] || continue
if ! $hook pre-rtupdate python$oldv @PVER@; then
hb=$(basename $hook .rtupdate)
echo >&2 "error running python pre-rtupdate hook $hb"
errors=yes
fi
done
[ -z "$errors" ] || exit 3
#DEBHELPER# #DEBHELPER#
File moved
...@@ -19,12 +19,15 @@ Show the default python version. ...@@ -19,12 +19,15 @@ Show the default python version.
.I -s, --supported .I -s, --supported
Show the supported python versions. Show the supported python versions.
.TP .TP
.I -r, --requested <version string> | <control file> .I -r, --requested [<version string> | <control file>]
Reads the Reads the value of the
.B XS-Python-Version .B XS-Python-Version
value in the source section of a control file and shows all field in the source section of a control file and shows all matching
matching python versions. The parameter is interpreted as python versions. The parameter is interpreted as a version string, if
a version string, if it is not the name of a file. it is not the name of a file. If the XS-Python-Version field is
missing, get the version information from debian/pyversions.
Without any parameter, it will fall back to list the supported Python
versions after checking debian/control and debian/pyversions.
.TP .TP
.I -i, --installed .I -i, --installed
Show the installed supported python versions. Show the installed supported python versions.
......
...@@ -128,6 +128,11 @@ def installed_versions(version_only=False): ...@@ -128,6 +128,11 @@ def installed_versions(version_only=False):
else: else:
return versions return versions
class ControlFileValueError(ValueError):
pass
class MissingVersionValueError(ValueError):
pass
def extract_pyversion_attribute(fn, pkg): def extract_pyversion_attribute(fn, pkg):
"""read the debian/control file, extract the XS-Python-Version """read the debian/control file, extract the XS-Python-Version
field; check that XB-Python-Version exists for the package.""" field; check that XB-Python-Version exists for the package."""
...@@ -138,11 +143,13 @@ def extract_pyversion_attribute(fn, pkg): ...@@ -138,11 +143,13 @@ def extract_pyversion_attribute(fn, pkg):
for line in file(fn): for line in file(fn):
line = line.strip() line = line.strip()
if line == '': if line == '':
if pkg == 'Source':
break
section = None section = None
elif line.startswith('Source:'): elif line.startswith('Source:'):
section = 'Source' section = 'Source'
elif line.startswith('Package: ' + pkg): elif line.startswith('Package: ' + pkg):
section = self.name section = pkg
elif line.startswith('XS-Python-Version:'): elif line.startswith('XS-Python-Version:'):
if section != 'Source': if section != 'Source':
raise ValueError, \ raise ValueError, \
...@@ -151,15 +158,55 @@ def extract_pyversion_attribute(fn, pkg): ...@@ -151,15 +158,55 @@ def extract_pyversion_attribute(fn, pkg):
elif line.startswith('XB-Python-Version:'): elif line.startswith('XB-Python-Version:'):
if section == pkg: if section == pkg:
version = line.split(':', 1)[1].strip() version = line.split(':', 1)[1].strip()
if section == None:
raise ControlFileValueError, 'not a control file'
if pkg == 'Source': if pkg == 'Source':
if sversion == None: if sversion == None:
raise ValueError, 'missing XS-Python-Version in control file' raise MissingVersionValueError, \
'missing XS-Python-Version in control file'
return sversion return sversion
if version == None: if version == None:
raise ValueError, \ raise MissingVersionValueError, \
'missing XB-Python-Version for package `%s' % pkg 'missing XB-Python-Version for package `%s' % pkg
return version return version
# compatibility functions to parse debian/pyversions
def version_cmp(ver1,ver2):
v1=[int(i) for i in ver1.split('.')]
v2=[int(i) for i in ver2.split('.')]
return cmp(v1,v2)
def requested_versions_bis(vstring, version_only=False):
versions = []
py_supported_short = supported_versions(version_only=True)
for item in vstring.split(','):
v=item.split('-')
if len(v)>1:
if not v[0]:
v[0] = py_supported_short[0]
if not v[1]:
v[1] = py_supported_short[-1]
for ver in py_supported_short:
try:
if version_cmp(ver,v[0]) >= 0 \
and version_cmp(ver,v[1]) <= 0:
versions.append(ver)
except ValueError:
pass
else:
if v[0] in py_supported_short:
versions.append(v[0])
versions.sort(version_cmp)
if not versions:
raise ValueError, 'empty set of versions'
if not version_only:
versions=['python'+i for i in versions]
return versions
def extract_pyversion_attribute_bis(fn):
vstring = file(fn).readline().rstrip('\n')
return vstring
def main(): def main():
from optparse import OptionParser from optparse import OptionParser
...@@ -173,7 +220,7 @@ def main(): ...@@ -173,7 +220,7 @@ def main():
action='store_true', dest='supported') action='store_true', dest='supported')
parser.add_option('-r', '--requested', parser.add_option('-r', '--requested',
help='print the python versions requested by a build; the argument is either the name of a control file or the value of the XS-Python-Version attribute', help='print the python versions requested by a build; the argument is either the name of a control file or the value of the XS-Python-Version attribute',
action='store', dest='versions') action='store_true', dest='requested')
parser.add_option('-i', '--installed', parser.add_option('-i', '--installed',
help='print the installed supported python versions', help='print the installed supported python versions',
action='store_true', dest='installed') action='store_true', dest='installed')
...@@ -183,24 +230,46 @@ def main(): ...@@ -183,24 +230,46 @@ def main():
opts, args = parser.parse_args() opts, args = parser.parse_args()
program = os.path.basename(sys.argv[0]) program = os.path.basename(sys.argv[0])
if opts.default: if opts.default and len(args) == 0:
print default_version(opts.version_only) print default_version(opts.version_only)
elif opts.supported: elif opts.supported and len(args) == 0:
print ' '.join(supported_versions(opts.version_only)) print ' '.join(supported_versions(opts.version_only))
elif opts.installed: elif opts.installed and len(args) == 0:
print ' '.join(installed_versions(opts.version_only)) print ' '.join(installed_versions(opts.version_only))
elif opts.versions: elif opts.requested and len(args) <= 1:
if len(args) == 0:
versions = 'debian/control'
else:
versions = args[0]
try: try:
if os.path.isfile(opts.versions): if os.path.isfile(versions):
vs = extract_pyversion_attribute(opts.versions, 'Source') fn = versions
try:
vstring = extract_pyversion_attribute(fn, 'Source')
vs = requested_versions(vstring, opts.version_only)
except ControlFileValueError:
sys.stderr.write("%s: not a control file: %s, " \
% (program, fn))
sys.exit(1)
except MissingVersionValueError:
fn = os.path.join(os.path.dirname(fn), 'pyversions')
sys.stderr.write("%s: missing XS-Python-Version in control file, fall back to %s\n" \
% (program, fn))
try:
vstring = extract_pyversion_attribute_bis(fn)
vs = requested_versions_bis(vstring, opts.version_only)
except IOError:
sys.stderr.write("%s: missing debian/pyversions file, fall back to supported versions\n" \
% program)
vs = supported_versions(opts.version_only)
else: else:
vs = opts.versions vs = requested_versions(versions, opts.version_only)
print ' '.join(requested_versions(vs, opts.version_only)) print ' '.join(vs)
except ValueError, msg: except ValueError, msg:
print "%s: %s" % (program, msg) sys.stderr.write("%s: %s\n" % (program, msg))
sys.exit(1) sys.exit(1)
else: else:
print "usage: %s %s" % (program, usage) sys.stderr.write("usage: %s %s\n" % (program, usage))
sys.exit(1) sys.exit(1)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -25,9 +25,12 @@ scriptdir = usr/share/python$(VER) ...@@ -25,9 +25,12 @@ scriptdir = usr/share/python$(VER)
scriptdir = usr/lib/python$(VER) scriptdir = usr/lib/python$(VER)
rst2html = $(PVER) /usr/share/python-docutils/rst2html.py rst2html = $(PVER) /usr/share/python-docutils/rst2html.py
rst2html = rst2html
with_doc = no with_doc = no
NOPKGS = -Npython-doc ifneq ($(with_doc),yes)
NOPKGS = -Npython-doc
endif
build: stamp-build build: stamp-build
stamp-build: stamp-build:
......
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