Your message dated Sat, 21 Feb 2009 15:02:22 +0000
with message-id <[email protected]>
and subject line Bug#494016: fixed in python-central 0.6.10
has caused the Debian Bug report #494016,
regarding report files to cruft
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
494016: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494016
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-central
Version: 0.6.8
Severity: normal
Tags: patch

I have added support for reporting pycentral-managed files to cruft.

This incidentaly adds two commands to pycentral: pkglist and list.

-- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 
'hardy-proposed'), (500, 'hardy-backports'), (500, 'hardy')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-20-generic (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-central depends on:
ii  python                    2.5.2-0ubuntu1 An interactive high-level object-o

python-central recommends no packages.

-- no debconf information
>From c4d70217dd90c628e59422c59b50c9d47c28e0ef Mon Sep 17 00:00:00 2001
From: Gabriel de Perthuis <[email protected]>
Date: Wed, 6 Aug 2008 18:01:54 +0200
Subject: [PATCH] Add pkglist command, to list pycentral-managed files for a specific package.

---
 pycentral.1  |    3 ++
 pycentral.py |   73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/pycentral.1 b/pycentral.1
index 36088c2..216b7d7 100644
--- a/pycentral.1
+++ b/pycentral.1
@@ -37,6 +37,9 @@ Prepare a package for all supported runtimes.
 .I pkgremove
 Remove a package installed for all supported runtimes.
 .TP
+.I pkglist
+List pycentral-managed files of a package for all supported runtimes.
+.TP
 .I rtinstall
 Make installed packages available for this runtime.
 .TP
diff --git a/pycentral.py b/pycentral.py
index c10c587..6ddb610 100755
--- a/pycentral.py
+++ b/pycentral.py
@@ -197,6 +197,13 @@ class PythonRuntime:
         if errors:
             raise PyCentralError, 'error removing the byte-code files'
 
+    def list_byte_code(self, files):
+        logging.debug('\tremove byte-code files (%d)' % (len(files)))
+        for ext in ('c', 'o'):
+            for fn in files:
+                fnc = fn + ext
+		yield fnc
+
 installed_runtimes = None
 default_runtime = None
 
@@ -869,6 +876,15 @@ class DebPackage:
                 if os.path.exists(fn2):
                     os.unlink(fn2)
 
+    def list_shared_files(self, rt):
+        logging.debug('\tlist_shared_files %s/%s' % (rt.name, self.name))
+        if not self.shared_files:
+            return
+        ppos = len(self.shared_prefix)
+        for fn in self.shared_files:
+            fn2 = rt.prefix + fn[ppos:]
+	    yield fn2
+
 
     def install(self, runtimes, bc_option, exclude_regex,
                 byte_compile_default=True, ignore_errors=False):
@@ -1074,6 +1090,32 @@ class DebPackage:
             if self.private_files:
                 default_runtime.remove_byte_code(self.private_files)
 
+    def list(self, runtimes, list_script_files=True):
+        logging.debug('\tlist package %s' % self.name)
+        # list shared .py files
+        if self.shared_files:
+            ppos = len(self.shared_prefix)
+            for rt in runtimes:
+                linked_files = [ rt.prefix + fn[ppos:]
+                                 for fn in self.shared_files
+                                 if fn[-3:] == '.py']
+		for f in default_runtime.list_byte_code(linked_files):
+		    yield f
+		for f in self.list_shared_files(rt):
+		    yield f
+        # list byte compiled files inside prefix
+        if self.pylib_files:
+            for pyver, files in self.pylib_files.items():
+                rt = get_runtime_for_version(pyver)
+                if rt in runtimes:
+		    for f in default_runtime.list_byte_code(files):
+			yield f
+        # list byte code for script files
+        if list_script_files:
+            if self.private_files:
+		for f in default_runtime.list_byte_code(self.private_files):
+		    yield f
+
     def update_bytecode_files(self, runtimes, rt_default, bc_option):
         # byte-compile with default python version
         logging.debug('\tupdate byte-code for %s' % self.name)
@@ -1414,6 +1456,37 @@ class ActionPkgRemove(Action):
 
 register_action(ActionPkgRemove)
 
+class ActionPkgList(Action):
+    name = 'pkglist'
+    help = 'list all pycentral-managed files for <package>'
+    usage = '<package>'
+
+    def check_args(self, global_options):
+        if len(self.args) != 1:
+            self._option_parser.print_help()
+            sys.exit(1)
+        self.pkgname = self.args[0]
+        if not os.path.exists('/var/lib/dpkg/info/%s.list' % self.pkgname):
+            self.error("package %s is not installed" % self.pkgname)
+        return self.errors_occured
+
+    def run(self, global_options):
+        runtimes = get_installed_runtimes(with_unsupported=True)
+        pkg = DebPackage('package', self.args[0], oldstyle=False)
+        pkg.read_version_info()
+        try:
+            pkg.set_default_runtime_from_version_info()
+        except ValueError:
+            # original runtime may be removed, use the default
+            pkg.default_runtime = get_default_runtime()
+        try:
+	    for f in pkg.list(runtimes, list_script_files=True):
+		print f
+        except PyCentralError, msg:
+            self.error(msg)
+
+register_action(ActionPkgList)
+
 
 class ActionRuntimeInstall(Action):
     name = 'rtinstall'
-- 
1.6.0.rc1.64.g61192

>From 40d63992837c30378de9620941c969add3be1e0e Mon Sep 17 00:00:00 2001
From: Gabriel de Perthuis <[email protected]>
Date: Wed, 6 Aug 2008 18:20:33 +0200
Subject: [PATCH] Add 'list' action.

---
 pycentral.1  |    3 +++
 pycentral.py |   21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/pycentral.1 b/pycentral.1
index 216b7d7..9f825d9 100644
--- a/pycentral.1
+++ b/pycentral.1
@@ -28,6 +28,9 @@ Byte compile .py files in a package.
 .I bcremove
 Remove the byte compiled .py files.
 .TP
+.I list
+List all managed files.
+.TP
 .I pkginstall
 Make a package available for all supported runtimes.
 .TP
diff --git a/pycentral.py b/pycentral.py
index 6ddb610..a1a63aa 100755
--- a/pycentral.py
+++ b/pycentral.py
@@ -1666,6 +1666,27 @@ class ActionUpdateDefault(Action):
 register_action(ActionUpdateDefault)
 
 
+class ActionList(Action):
+    name = 'list'
+    help = 'List all pycentral-managed files'
+
+    def check_args(self, global_options):
+        if len(self.args) != 0:
+            self._option_parser.print_help()
+            sys.exit(1)
+        return self.errors_occured
+
+    def run(self, global_options):
+        runtimes = get_installed_runtimes(with_unsupported=True)
+       for (p, v) in read_dpkg_status():
+           pkg = DebPackage('package', p)
+           pkg.read_version_info()
+           for f in pkg.list(runtimes, list_script_files=True):
+               print f
+
+register_action(ActionList)
+
+
 class ActionShowDefault(Action):
     name = 'showdefault'
     help = 'Show default python version number'
-- 
1.6.0.rc1.64.g61192

>From ce217de42b52d7f85ad5ecd9d10fa808b4a6fef4 Mon Sep 17 00:00:00 2001
From: Gabriel de Perthuis <[email protected]>
Date: Wed, 6 Aug 2008 18:39:41 +0200
Subject: [PATCH] Add a cruft explain script.

Cruft will pick up this script automatically.
The script tells cruft that pycentral-managed files
have a valid reason for being on the system.
---
 debian/dirs            |    1 +
 debian/rules           |    2 ++
 python-central.explain |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100755 python-central.explain

diff --git a/debian/dirs b/debian/dirs
index 891bf2f..2d3cebc 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,4 +1,5 @@
 usr/bin
+usr/lib/cruft/explain
 usr/share/pycentral-data
 usr/share/debhelper/autoscripts
 usr/share/python/runtime.d
diff --git a/debian/rules b/debian/rules
index abf54ef..3730124 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,6 +39,8 @@ install: build
                debian/$(PACKAGE)/usr/share/python/runtime.d/
        install -m644 python_central.pm \
                debian/$(PACKAGE)/usr/share/perl5/Debian/Debhelper/Sequence/
+       install -m755 python-central.explain \
+               debian/$(PACKAGE)/usr/lib/cruft/explain/python-central
 
 # Build architecture-independent files here.
 binary-indep: build install
diff --git a/python-central.explain b/python-central.explain
new file mode 100755
index 0000000..c62be42
--- /dev/null
+++ b/python-central.explain
@@ -0,0 +1,2 @@
+#!/bin/sh
+pycentral list >&3
-- 
1.6.0.rc1.64.g61192


--- End Message ---
--- Begin Message ---
Source: python-central
Source-Version: 0.6.10

We believe that the bug you reported is fixed in the latest version of
python-central, which is due to be installed in the Debian FTP archive:

python-central_0.6.10.dsc
  to pool/main/p/python-central/python-central_0.6.10.dsc
python-central_0.6.10.tar.gz
  to pool/main/p/python-central/python-central_0.6.10.tar.gz
python-central_0.6.10_all.deb
  to pool/main/p/python-central/python-central_0.6.10_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <[email protected]> (supplier of updated python-central package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 21 Feb 2009 14:52:26 +0100
Source: python-central
Binary: python-central
Architecture: source all
Version: 0.6.10
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <[email protected]>
Changed-By: Matthias Klose <[email protected]>
Description: 
 python-central - register and build utility for Python packages
Closes: 403872 489977 494016 494290
Changes: 
 python-central (0.6.10) unstable; urgency=low
 .
   * dh_pycentral: Handle special characters in package name (Alexander
     Achenbach). Closes: #494290.
   * Add support for reporting pycentral-managed files to cruft, adding
     new commands pkglist and list (Gabriel de Perthuis). Closes: #494016.
   * Don't be verbose about using older python versions. Closes: #403872.
   * pycentral: Add names of overwritten local files. Closes: #489977.
   * /usr/share/pycentral-data/pycentral.mk: makefile macros (currently
     just sitedir).
   * Fix handling of `:' and `=' characters in file names.
   * Enable the option to include the symbolic links to sys.path in
     the package (calling DH_PYCENTRAL=include-links dh_pycentral).
   * Merge the pyversions.py code with the version in python-defaults.
   * Ignore the pkgprepare option; packages which need to be available
     during upgrades should install directly into sys.path.
Checksums-Sha1: 
 7ba731b99307f56c4b52ed3b5a5965ace7fc3d48 822 python-central_0.6.10.dsc
 658e22da608b5b16dc3166eebef417edafc8b815 41369 python-central_0.6.10.tar.gz
 0d9f50ba433533e3404398227ed08b4486f82930 44732 python-central_0.6.10_all.deb
Checksums-Sha256: 
 ab828800715eec8a3f191859a558ac702f1db1276feadf8ab4eae390945499bf 822 
python-central_0.6.10.dsc
 947a5f60c1c3a35374b1a09072a5a089304455e0f25870e78e75f1958bde9349 41369 
python-central_0.6.10.tar.gz
 237e51c429822db040a02b9fc2f6483d548243e6f2c406fbfe835fcfa15e1939 44732 
python-central_0.6.10_all.deb
Files: 
 550a0be17d8f58581c19bfe4f06cf547 822 python standard python-central_0.6.10.dsc
 feef4e94e6446518793f92d3b1c93d8f 41369 python standard 
python-central_0.6.10.tar.gz
 329b17da033dcab96809f6aee0be3f98 44732 python standard 
python-central_0.6.10_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmgD/QACgkQStlRaw+TLJwBIACdEphqBHvN1HPwfJ6W/0pmYtWw
NfMAoLH47jlkL+czg+8Ka7+OeeCTOuv+
=nOSW
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to