From 10858f98f759a2407ac596582687581a2ed33d34 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 29 Mar 2009 16:35:39 +0200 Subject: Build-Depend on python-debian, use it to get version number from changelog --- debian/changelog | 6 ++++++ debian/control | 11 ++++++++++- doc/source/conf.py | 7 +++++-- setup.py | 22 +++++++++++++++++----- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index f996ef5b..3f7b420d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-apt (0.7.10~exp1) experimental; urgency=low + + * Build-Depend on python-debian, use it to get version number from changelog + + -- Julian Andres Klode Sun, 29 Mar 2009 14:09:18 +0200 + python-apt (0.7.9) unstable; urgency=low [ Julian Andres Klode ] diff --git a/debian/control b/debian/control index 41e3af4a..932a2b4f 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,16 @@ Maintainer: APT Development Team Uploaders: Matt Zimmerman , Michael Vogt Standards-Version: 3.7.2.2 XS-Python-Version: all -Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.7.10), apt-utils, python-all-dev, python-distutils-extra (>= 1.9.0), cdbs, python-central (>= 0.5), python-all-dbg, python-sphinx (>= 0.5) +Build-Depends: apt-utils, + cdbs, + debhelper (>= 5.0.37.1), + libapt-pkg-dev (>= 0.7.10), + python-all-dbg, + python-all-dev, + python-central (>= 0.5), + python-debian, + python-distutils-extra (>= 1.9.0), + python-sphinx (>= 0.5) Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-sid Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes diff --git a/doc/source/conf.py b/doc/source/conf.py index 3b0ebed7..17fe6a23 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -56,10 +56,13 @@ copyright = u'2009, Julian Andres Klode ' # |version| and |release|, also used in various other places throughout the # built documents. # +from debian_bundle.changelog import Changelog + +changes = Changelog(open('../../debian/changelog')) # The short X.Y version. -version = '0.7' +version = '.'.join(changes.full_version.split('.')[:2]) # The full version, including alpha/beta/rc tags. -release = '0.7.9~exp3' +release = changes.full_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index fc046381..1c266ce7 100755 --- a/setup.py +++ b/setup.py @@ -1,14 +1,26 @@ #! /usr/bin/env python # $Id: setup.py,v 1.2 2002/01/08 07:13:21 jgg Exp $ - -from distutils.core import setup, Extension -from distutils.sysconfig import parse_makefile -from DistUtilsExtra.command import build_extra, build_i18n import glob import os import shutil import sys +from distutils.core import setup, Extension +from distutils.sysconfig import parse_makefile +from DistUtilsExtra.command import build_extra, build_i18n + + +class FakeDebianSupportModule(object): + """Work around the python-apt dependency of debian_support.""" + + class Version(object): + """Empty class.""" + +sys.modules['debian_bundle.debian_support'] = FakeDebianSupportModule + +from debian_bundle.changelog import Changelog + + # The apt_pkg module files = map(lambda source: "python/"+source, @@ -46,7 +58,7 @@ if len(sys.argv) > 1 and sys.argv[1] == "clean" and '-a' in sys.argv: print "Not removing", dirname, "because it does not exist" setup(name="python-apt", - version="0.7.9", + version=Changelog(open('debian/changelog')).full_version, description="Python bindings for APT", author="APT Development Team", author_email="deity@lists.debian.org", -- cgit v1.2.3 From bea068087a98e03bbdaae2ac46287ed0d69e509a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 15:25:03 +0200 Subject: Depend on libjs-jquery, and remove internal copy --- debian/changelog | 3 ++- debian/control | 3 ++- debian/rules | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3f7b420d..3244d439 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ python-apt (0.7.10~exp1) experimental; urgency=low * Build-Depend on python-debian, use it to get version number from changelog + * Depend on libjs-jquery, and remove internal copy - -- Julian Andres Klode Sun, 29 Mar 2009 14:09:18 +0200 + -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 python-apt (0.7.9) unstable; urgency=low diff --git a/debian/control b/debian/control index 932a2b4f..6e0acd94 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,8 @@ Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes Package: python-apt Architecture: any -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release +Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release, + libjs-jquery Recommends: iso-codes Priority: optional Provides: ${python:Provides} diff --git a/debian/rules b/debian/rules index 90b48cda..a2802ea7 100755 --- a/debian/rules +++ b/debian/rules @@ -22,9 +22,6 @@ build/python-apt-dbg:: python$$i-dbg ./setup.py build; \ done -build/python-apt:: - pydoc -w - install/python-apt-dbg:: for i in $(cdbs_python_build_versions); do \ python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-apt-dbg; \ @@ -33,6 +30,9 @@ install/python-apt-dbg:: ! -type d ! -name '*_d.so' | xargs rm -f find debian/python-apt-dbg -depth -empty -exec rmdir {} \; +binary-predeb/python-apt:: + ln -sf ../../../../javascript/jquery/jquery.js debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js + binary-predeb/python-apt-dbg:: rm -rf debian/python-apt-dbg/usr/share/doc/python-apt-dbg ln -s python-apt debian/python-apt-dbg/usr/share/doc/python-apt-dbg -- cgit v1.2.3 From 3fbbced1f6d22d6ce3a7188032b0d19251159fbd Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 15:34:44 +0200 Subject: * apt/package.py: Introduce Version.{uri,uris,fetch_binary()} --- apt/package.py | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++----- debian/changelog | 2 + 2 files changed, 109 insertions(+), 9 deletions(-) diff --git a/apt/package.py b/apt/package.py index 37cd33fb..595cf8ec 100644 --- a/apt/package.py +++ b/apt/package.py @@ -41,6 +41,17 @@ def _(string): return gettext.dgettext("python-apt", string) +def _file_is_same(path, size, md5): + """Return True if the file is the same.""" + if (os.path.exists(path) and os.path.getsize(path) == size and + apt_pkg.md5sum(open(path)) == md5): + return True + + +class FetchError(Exception): + """Raised when a file could not be fetched.""" + + class BaseDependency(object): """A single dependency. @@ -338,10 +349,87 @@ class Version(object): origins.append(Origin(self.package, verFileIter)) return origins - def fetch_source(self): - """Get the source code of a package""" + @property + def filename(self): + """Return the path to the file inside the archive.""" + return self._records.FileName + + @property + def md5(self): + """Return the md5sum of the binary.""" + return self._records.MD5Hash + + @property + def sha1(self): + """Return the sha1sum of the binary.""" + return self._records.SHA1Hash + + @property + def sha256(self): + """Return the sha1sum of the binary.""" + return self._records.SHA256Hash + + def _uris(self): + """Return an iterator over all available urls.""" + for (packagefile, index) in self._cand.FileList: + indexfile = self.package._pcache._list.FindIndex(packagefile) + if indexfile: + yield indexfile.ArchiveURI(self._records.FileName) + + @property + def uris(self): + """Return a list of all available uris for the binary.""" + return list(self._uris()) + + @property + def uri(self): + """Return a single URI for the binary.""" + return self._uris().next() + + def fetch_binary(self, destdir='', progress=None): + """Fetch the binary version of the package. + + The parameter 'destdir' specifies the directory where the package will + be fetched to. + + The parameter 'progress' may refer to an apt.progress.FetchProgress() + object. If not specified or None, apt.progress.TextFetchProgress() is + used. + """ + base = os.path.basename(self._records.FileName) + destfile = os.path.join(destdir, base) + if _file_is_same(destfile, self.size, self._records.MD5Hash): + print 'Ignoring already existing file:', destfile + return + acq = apt_pkg.GetAcquire(progress or apt.progress.TextFetchProgress()) + apt_pkg.GetPkgAcqFile(acq, self.uri, self._records.MD5Hash, self.size, + base, destFile=destfile) + acq.Run() + for item in acq.Items: + if item.Status != item.StatDone: + raise FetchError("The item %r could not be fetched: %s" % + (item.DestFile, item.ErrorText)) + return os.path.abspath(destfile) + + def fetch_source(self, destdir="", progress=None, unpack=True): + """Get the source code of a package. + + The parameter 'destdir' specifies the directory where the source will + be fetched to. + + The parameter 'progress' may refer to an apt.progress.FetchProgress() + object. If not specified or None, apt.progress.TextFetchProgress() is + used. + + The parameter 'unpack' describes whether the source should be unpacked + (True) or not (False). By default, it is unpacked. + + If 'unpack' is True, the path to the extracted directory is returned. + Otherwise, the path to the .dsc file is returned. + """ src = apt_pkg.GetPkgSrcRecords() - acq = apt_pkg.GetAcquire(apt.progress.TextFetchProgress()) + acq = apt_pkg.GetAcquire(progress or apt.progress.TextFetchProgress()) + dsc = None src.Lookup(self.package.name) try: @@ -351,23 +439,33 @@ class Version(object): raise ValueError("No source for %r" % self) for md5, size, path, type in src.Files: base = os.path.basename(path) + destfile = os.path.join(destdir, base) if type == 'dsc': - dsc = base + dsc = destfile if os.path.exists(base) and os.path.getsize(base) == size: fobj = open(base) try: if apt_pkg.md5sum(fobj) == md5: - print 'Ignoring already existing file', base + print 'Ignoring already existing file:', destfile continue finally: fobj.close() apt_pkg.GetPkgAcqFile(acq, src.Index.ArchiveURI(path), md5, size, - base) + base, destFile=destfile) acq.Run() - outdir = src.Package + '-' + apt_pkg.UpstreamVersion(src.Version) - subprocess.check_call(["dpkg-source", "-x", dsc, outdir]) - return os.path.abspath(outdir) + for item in acq.Items: + if item.Status != item.StatDone: + raise FetchError("The item %r could not be fetched: %s" % + (item.DestFile, item.ErrorText)) + + if unpack: + outdir = src.Package + '-' + apt_pkg.UpstreamVersion(src.Version) + outdir = os.path.join(destdir, outdir) + subprocess.check_call(["dpkg-source", "-x", dsc, outdir]) + return os.path.abspath(outdir) + else: + return os.path.abspath(dsc) class Package(object): diff --git a/debian/changelog b/debian/changelog index 3244d439..0015319c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ python-apt (0.7.10~exp1) experimental; urgency=low * Build-Depend on python-debian, use it to get version number from changelog * Depend on libjs-jquery, and remove internal copy + * apt/package.py: + - Introduce Version.{uri,uris,fetch_binary()} -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 -- cgit v1.2.3 From 376f7b202b67393c68e7aa7a219a5d6b02b914d1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 15:42:01 +0200 Subject: Remove mdz from Uploaders (Closes: #521477), add myself. --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3dc359c7..36ffc2b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ python-apt (0.7.10~exp1) experimental; urgency=low * Depend on libjs-jquery, and remove internal copy * apt/package.py: - Introduce Version.{uri,uris,fetch_binary()} + * Remove mdz from Uploaders (Closes: #521477), add myself. -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 @@ -31,7 +32,7 @@ python-apt (0.7.9) unstable; urgency=low - add Recommends to iso-codes (for iso_3166.xml) * apt/package.py: - make sure to set the defaulttimeout back to the - original value (in getChangelog(), LP: #314212) + original value (in getChangelog(), LP: #314212) Closes: #513315 * apt/cache.py: - when setting a alternative rootdir, read the diff --git a/debian/control b/debian/control index 6e0acd94..d0fbfdfa 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: python-apt Section: python Priority: optional Maintainer: APT Development Team -Uploaders: Matt Zimmerman , Michael Vogt +Uploaders: Michael Vogt , Julian Andres Klode Standards-Version: 3.7.2.2 XS-Python-Version: all Build-Depends: apt-utils, -- cgit v1.2.3 From e945bab415a4b61b9ee00ad11d02c0b583f073b5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 15:43:15 +0200 Subject: debian/control: Add ${misc:Depends} to python-apt-dbg dependencies. --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index d0fbfdfa..47557615 100644 --- a/debian/control +++ b/debian/control @@ -43,7 +43,8 @@ Description: Python interface to libapt-pkg Package: python-apt-dbg Priority: extra Architecture: any -Depends: python-dbg, python-apt (= ${Source-Version}), ${shlibs:Depends} +Depends: python-dbg, python-apt (= ${Source-Version}), ${shlibs:Depends}, + ${misc:Depends} Description: Python interface to libapt-pkg (debug extension) The apt_pkg Python interface will provide full access to the internal libapt-pkg structures allowing Python programs to easily perform a -- cgit v1.2.3 From aa0e9335d3861a934eef359894f7d0d1b6164bec Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 15:44:33 +0200 Subject: debian/control: Remove useless Priority: optional in python-apt, move python-apt-dbg to debug section. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 47557615..5ce48bd1 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,6 @@ Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release, libjs-jquery Recommends: iso-codes -Priority: optional Provides: ${python:Provides} Suggests: python-apt-dbg, python-gtk2, python-vte XB-Python-Version: ${python:Versions} @@ -43,6 +42,7 @@ Description: Python interface to libapt-pkg Package: python-apt-dbg Priority: extra Architecture: any +Section: debug Depends: python-dbg, python-apt (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} Description: Python interface to libapt-pkg (debug extension) -- cgit v1.2.3 From 14bf76bdb50dc8ee450776ca1525e7c25a4a608e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 16:24:59 +0200 Subject: * debian/control: Standards-Version, ${binary:Version}. - Update Standards-Version to 3.8.1 - Use ${binary:Version} instead of ${Source-Version} --- debian/changelog | 5 ++++- debian/control | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 36ffc2b4..f51944f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,10 @@ python-apt (0.7.10~exp1) experimental; urgency=low * Depend on libjs-jquery, and remove internal copy * apt/package.py: - Introduce Version.{uri,uris,fetch_binary()} - * Remove mdz from Uploaders (Closes: #521477), add myself. + * debian/control: + - Remove mdz from Uploaders (Closes: #521477), add myself. + - Update Standards-Version to 3.8.1 + - Use ${binary:Version} instead of ${Source-Version} -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/control b/debian/control index 5ce48bd1..9afd50e0 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: python Priority: optional Maintainer: APT Development Team Uploaders: Michael Vogt , Julian Andres Klode -Standards-Version: 3.7.2.2 +Standards-Version: 3.8.1 XS-Python-Version: all Build-Depends: apt-utils, cdbs, @@ -43,7 +43,7 @@ Package: python-apt-dbg Priority: extra Architecture: any Section: debug -Depends: python-dbg, python-apt (= ${Source-Version}), ${shlibs:Depends}, +Depends: python-dbg, python-apt (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: Python interface to libapt-pkg (debug extension) The apt_pkg Python interface will provide full access to the internal -- cgit v1.2.3 From 312b5ca7acbe74bc73acc2b710628ea2a8ad83cc Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 16:27:15 +0200 Subject: * Copyright updates: debian/copyright, etc. - debian/copyright: Switch to machine-interpretable copyright - apt/*.py: Fix the copyright years and comments. --- apt/__init__.py | 18 +++++++++++++++ apt/cache.py | 2 +- apt/cdrom.py | 2 +- apt/debfile.py | 31 ++++++++++++------------- apt/package.py | 2 +- apt/progress/__init__.py | 4 ++-- apt/progress/gtk2.py | 2 +- aptsources/distinfo.py | 10 ++++---- aptsources/distro.py | 4 ++-- aptsources/sourceslist.py | 12 +++++----- debian/changelog | 1 + debian/copyright | 58 ++++++++++++++++++++++++++++++++++++++++++----- 12 files changed, 103 insertions(+), 43 deletions(-) diff --git a/apt/__init__.py b/apt/__init__.py index e3cfacbe..ae2abbf2 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -1,3 +1,21 @@ +# Copyright (c) 2005-2009 Canonical +# +# Author: Michael Vogt +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA # import the core of apt_pkg import apt_pkg import sys diff --git a/apt/cache.py b/apt/cache.py index a9430d6b..cc425ccb 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -1,6 +1,6 @@ # cache.py - apt cache abstraction # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/cdrom.py b/apt/cdrom.py index 61250fc4..b52762ad 100644 --- a/apt/cdrom.py +++ b/apt/cdrom.py @@ -1,6 +1,6 @@ # cdrom.py - CDROM handling # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # Copyright (c) 2009 Julian Andres Klode # # Author: Michael Vogt diff --git a/apt/debfile.py b/apt/debfile.py index c550d766..0406a250 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -1,24 +1,21 @@ -# Copyright (c) 2005-2007 Canonical +# Copyright (c) 2005-2009 Canonical # -# AUTHOR: -# Michael Vogt +# Author: Michael Vogt # -# This file is part of GDebi +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. # -# GDebi is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# GDebi is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GDebi; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA """Classes for working with locally available Debian packages.""" from gettext import gettext as _ import os diff --git a/apt/package.py b/apt/package.py index 595cf8ec..9afe1674 100644 --- a/apt/package.py +++ b/apt/package.py @@ -1,6 +1,6 @@ # package.py - apt package abstraction # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 51eb2426..769942ce 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -1,6 +1,6 @@ -# Progress.py - progress reporting classes +# progress.py - progress reporting classes # -# Copyright (c) 2005 Canonical +# Copyright (c) 2005-2009 Canonical # # Author: Michael Vogt # diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py index 435265d4..f872e34f 100644 --- a/apt/progress/gtk2.py +++ b/apt/progress/gtk2.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (c) 2004-2005 Canonical +# Copyright (c) 2004-2009 Canonical # # Authors: Michael Vogt # Sebastian Heinlein diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index 59fa7e02..ce44e48b 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -1,12 +1,10 @@ -#!/usr/bin/env python -# # distinfo.py - provide meta information for distro repositories # -# Copyright (c) 2005 Gustavo Noronha Silva -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2005 Gustavo Noronha Silva +# Copyright (c) 2006-2007 Sebastian Heinlein # -# Author: Gustavo Noronha Silva -# Sebastian Heinlein +# Authors: Gustavo Noronha Silva +# Sebastian Heinlein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff --git a/aptsources/distro.py b/aptsources/distro.py index d81c6e4a..bbb8ba50 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -1,7 +1,7 @@ # distro.py - Provide a distro abstraction of the sources.list # -# Copyright (c) 2004-2007 Canonical Ltd. -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2004-2009 Canonical Ltd. +# Copyright (c) 2006-2007 Sebastian Heinlein # # Authors: Sebastian Heinlein # Michael Vogt diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index b1f00446..1dfd870f 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -1,12 +1,12 @@ # aptsource.py - Provide an abstraction of the sources.list # -# Copyright (c) 2004-2007 Canonical Ltd. -# 2004 Michiel Sikkes -# 2006-2007 Sebastian Heinlein +# Copyright (c) 2004-2009 Canonical Ltd. +# Copyright (c) 2004 Michiel Sikkes +# Copyright (c) 2006-2007 Sebastian Heinlein # -# Author: Michiel Sikkes -# Michael Vogt -# Sebastian Heinlein +# Authors: Michiel Sikkes +# Michael Vogt +# Sebastian Heinlein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff --git a/debian/changelog b/debian/changelog index f51944f9..91ce7304 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.7.10~exp1) experimental; urgency=low - Remove mdz from Uploaders (Closes: #521477), add myself. - Update Standards-Version to 3.8.1 - Use ${binary:Version} instead of ${Source-Version} + * debian/copyright: Switch to machine-interpretable copyright -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/copyright b/debian/copyright index f8463185..8599328a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,53 @@ -APT is free software; you can redistribute them and/or modify them under -the terms of the GNU General Public License as published by the Free Software -Foundation; either version 2 of the License, or (at your option) any later -version. +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=443 -On Debian systems, a copy of the GNU General Public License can be -found in /usr/share/common-licenses/GPL. +Files: * +Copyright: © 2004-2009 Canonical Ltd. +License: GPL-2+ + +Files: aptsources/*.py +Copyright: © 2004-2009 Canonical Ltd. +Copyright: © 2005 Gustavo Noronha Silva +Copyright: © 2006-2007 Sebastian Heinlein +License: GPL-2+ + +Files: doc/source/* +Copyright: © 2009 Julian Andres Klode +License: GPL-2+ + +Files: utils/get_*.py +Copyright: © 2006 Free Software Foundation Europe +License: GPL-2+ + +Files: po/* +Copyright: © 2006 Canonical Ltd, and Rosetta Contributors 2006 +License: GPL-2+ + +Files: po/de.po +Copyright: © 2005 Michiel Sikkes +License: GPL-2+ + +Files: po/en_CA.po +Copyright: © 2005 Adam Weinberger and the GNOME Foundation +License: GPL-2+ + +Files: po/fi.po +Copyright: © 2005-2006 Timo Jyrinki +License: GPL-2+ + +Files: po/fr.po +Copyright: © 2007 Hugues NAULET +License: GPL-2+ + +Files: po/hu.po, po/lt.po, po/pt.po, po/ro.po, po/rw.po, po/sv.po, po/uk.po, + po/zh_HK.po +Copyright: © 2005-2006 Free Software Foundation +License: GPL-2+ + +License: GPL-2+ + APT is free software; you can redistribute them and/or modify them under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + . + On Debian systems, a copy of the GNU General Public License can be + found in /usr/share/common-licenses/GPL-2. -- cgit v1.2.3 From 192a186f6613f02e0fcef12da11412ec6001ed8c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 17:11:16 +0200 Subject: * Fix documentation building - doc/source/conf.py: Only include directories for current python version. - debian/control: Build-Depend on python-gtk2, python-vte. - setup.py: If pygtk can not be imported, do not build the documentation. --- debian/changelog | 4 ++++ debian/control | 4 +++- doc/source/conf.py | 6 +++++- setup.py | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 91ce7304..4bc94036 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,10 @@ python-apt (0.7.10~exp1) experimental; urgency=low - Update Standards-Version to 3.8.1 - Use ${binary:Version} instead of ${Source-Version} * debian/copyright: Switch to machine-interpretable copyright + * Fix documentation building + - doc/source/conf.py: Only include directories for current python version. + - debian/control: Build-Depend on python-gtk2, python-vte. + - setup.py: If pygtk can not be imported, do not build the documentation. -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/control b/debian/control index 9afd50e0..c06611e2 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,9 @@ Build-Depends: apt-utils, python-central (>= 0.5), python-debian, python-distutils-extra (>= 1.9.0), - python-sphinx (>= 0.5) + python-gtk2, + python-sphinx (>= 0.5), + python-vte Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-sid Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes diff --git a/doc/source/conf.py b/doc/source/conf.py index 17fe6a23..40154a6f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,9 +23,13 @@ import sys # absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('../..')) + +# Find the path to the built apt_pkg and apt_inst extensions if os.path.exists("../../build"): + version = '.'.join(str(x) for x in sys.version_info[:2]) for dirname in os.listdir('../../build'): - sys.path.insert(0, os.path.abspath('../../build/' + dirname)) + if version in dirname: + sys.path.insert(0, os.path.abspath('../../build/' + dirname)) # General configuration # --------------------- diff --git a/setup.py b/setup.py index 1c266ce7..3d378050 100755 --- a/setup.py +++ b/setup.py @@ -75,6 +75,11 @@ setup(name="python-apt", if len(sys.argv) > 1 and sys.argv[1] == "build": import sphinx + try: + import pygtk + except ImportError: + print >> sys.stderr, 'E: python-gtk2 is required to build documentation.' + sys.exit(0) sphinx.main(["sphinx", "-b", "html", "-d", "build/doc/doctrees", os.path.abspath("doc/source"), "build/doc/html"]) sphinx.main(["sphinx", "-b", "text", "-d", "build/doc/doctrees", -- cgit v1.2.3 From e3bdb73667560fcf662b8f1b5252b6e268d95e59 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 17:24:55 +0200 Subject: Set distribution to unstable, and close #521532 in the changelog --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4bc94036..4ef0b1f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ -python-apt (0.7.10~exp1) experimental; urgency=low +python-apt (0.7.10) unstable; urgency=low * Build-Depend on python-debian, use it to get version number from changelog - * Depend on libjs-jquery, and remove internal copy + * Depend on libjs-jquery, and remove internal copy (Closes: #521532) * apt/package.py: - Introduce Version.{uri,uris,fetch_binary()} * debian/control: -- cgit v1.2.3 From 0447f65d8f2497d2b0ee3b27c772873dfc9c1248 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 17:36:38 +0200 Subject: Breaks: debdelta (<< 0.28) to avoid more problems due to the internal API changes from 0.7.9. --- debian/changelog | 2 ++ debian/control | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4ef0b1f7..a4db252f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ python-apt (0.7.10) unstable; urgency=low - doc/source/conf.py: Only include directories for current python version. - debian/control: Build-Depend on python-gtk2, python-vte. - setup.py: If pygtk can not be imported, do not build the documentation. + * Breaks: debdelta (<< 0.28) to avoid more problems due to the internal + API changes from 0.7.9. -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/control b/debian/control index c06611e2..e50518ae 100644 --- a/debian/control +++ b/debian/control @@ -25,6 +25,7 @@ Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release, libjs-jquery Recommends: iso-codes +Breaks: debdelta (<< 0.28) Provides: ${python:Provides} Suggests: python-apt-dbg, python-gtk2, python-vte XB-Python-Version: ${python:Versions} -- cgit v1.2.3 From b05b23dc822c0cc93446cb67d18b73105248928c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 17:37:30 +0200 Subject: Fix spelling error: python -> Python --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a4db252f..f254200d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.7.10) unstable; urgency=low - Remove mdz from Uploaders (Closes: #521477), add myself. - Update Standards-Version to 3.8.1 - Use ${binary:Version} instead of ${Source-Version} + - Fix spelling error: python -> Python * debian/copyright: Switch to machine-interpretable copyright * Fix documentation building - doc/source/conf.py: Only include directories for current python version. diff --git a/debian/control b/debian/control index e50518ae..8943ae20 100644 --- a/debian/control +++ b/debian/control @@ -53,4 +53,4 @@ Description: Python interface to libapt-pkg (debug extension) libapt-pkg structures allowing Python programs to easily perform a variety of functions. . - This package contains the extension built for the python debug interpreter. + This package contains the extension built for the Python debug interpreter. -- cgit v1.2.3 From b2d0d968e0aa3e3211b1a697c02117b7c09fb384 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 1 Apr 2009 17:40:12 +0200 Subject: Fix Breaks 0.28 => 0.28~, so it works for backports as well. --- debian/changelog | 2 +- debian/control | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f254200d..04d6a5d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,7 +14,7 @@ python-apt (0.7.10) unstable; urgency=low - doc/source/conf.py: Only include directories for current python version. - debian/control: Build-Depend on python-gtk2, python-vte. - setup.py: If pygtk can not be imported, do not build the documentation. - * Breaks: debdelta (<< 0.28) to avoid more problems due to the internal + * Breaks: debdelta (<< 0.28~) to avoid more problems due to the internal API changes from 0.7.9. -- Julian Andres Klode Wed, 01 Apr 2009 15:24:29 +0200 diff --git a/debian/control b/debian/control index 8943ae20..4c7b542f 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release, libjs-jquery Recommends: iso-codes -Breaks: debdelta (<< 0.28) +Breaks: debdelta (<< 0.28~) Provides: ${python:Provides} Suggests: python-apt-dbg, python-gtk2, python-vte XB-Python-Version: ${python:Versions} -- cgit v1.2.3