[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#321507: marked as done (build-deps.py example doesn't work)



Your message dated Tue, 08 Nov 2005 20:32:02 -0800
with message-id <E1EZhcw-0002nD-00@spohr.debian.org>
and subject line Bug#321507: fixed in python-apt 0.6.14
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 5 Aug 2005 22:35:27 +0000
>From tbm@cyrius.com Fri Aug 05 15:35:26 2005
Return-path: <tbm@cyrius.com>
Received: from sorrow.cyrius.com [65.19.161.204] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1E1Amk-0007SP-00; Fri, 05 Aug 2005 15:35:26 -0700
Received: by sorrow.cyrius.com (Postfix, from userid 10)
	id 56F9A64D54; Fri,  5 Aug 2005 22:35:26 +0000 (UTC)
Received: by deprecation.cyrius.com (Postfix, from userid 1000)
	id B90F5838B; Fri,  5 Aug 2005 23:35:14 +0100 (BST)
Date: Fri, 5 Aug 2005 23:35:14 +0100
From: Martin Michlmayr <tbm@cyrius.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: build-deps.py example doesn't work
Message-ID: <20050805223514.GA18811@deprecation.cyrius.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf"
Content-Disposition: inline
X-Reportbug-Version: 3.12
User-Agent: Mutt/1.5.9i
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02


--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: python-apt
Version: 0.6.13.1
Severity: minor

The build-deps.py example fails with the following error (and has
other problems later on):

1219:tbm@deprecation: ~doc/python-apt/examples] ./build-deps.py
Reading package lists... Done
Building dependency tree... Done
Traceback (most recent call last):
  File "./build-deps.py", line 24, in ?
    srcrecords = apt_pkg.GetPkgSrcRecords()
TypeError: function takes exactly 1 argument (0 given)


Attached is a patch that works for me.  I also replaced set() with a
list since Debian's current Python default 2.3 doesn't know about
set().  Using 'except KeyError' instead of cache.has_key() is a bit of
a kludge but it seems there's no has_key() and I couldn't figure out
what to use instead.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages python-apt depends on:
ii  python                        2.3.5-2    An interactive high-level object-o
ii  python2.3-apt                 0.6.13.1   Python interface to libapt-pkg

-- no debconf information

-- 
Martin Michlmayr
http://www.cyrius.com/

--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p1

--- build-deps.py	2005-08-04 15:00:37.000000000 +0100
+++ /home/tbm/build-deps.py	2005-08-05 23:32:36.724229120 +0100
@@ -21,13 +21,18 @@
 depcache = apt_pkg.GetDepCache(cache)
 depcache.Init()
 records = apt_pkg.GetPkgRecords(cache)
-srcrecords = apt_pkg.GetPkgSrcRecords()
+srcrecords = apt_pkg.GetPkgSrcRecords(cache)
 
 # base package that we use for build-depends calculation
 if len(sys.argv) < 2:
 	print "need a pkgname as argument"
-base = cache[sys.argv[1]]
-all_build_depends = set()
+	sys.exit(1)
+try:
+    base = cache[sys.argv[1]]
+except KeyError:
+	print "No package %s" % sys.argv[1]
+	sys.exit(1)
+all_build_depends = []
 
 depends = base.CurrentVer.DependsList
 for dep in depends["Depends"]:
@@ -40,7 +45,7 @@
 		bd = srcrecords.BuildDepends
 		#print "%s: %s " % (srcpkg_name, bd)
 		for b in bd:
-			all_build_depends.add(b[0])
+			all_build_depends.append(b[0])
 			
 
 print "\n".join(all_build_depends)

--J2SCkAp4GZ/dPZZf--

---------------------------------------
Received: (at 321507-close) by bugs.debian.org; 9 Nov 2005 04:36:25 +0000
>From katie@spohr.debian.org Tue Nov 08 20:36:25 2005
Return-path: <katie@spohr.debian.org>
Received: from katie by spohr.debian.org with local (Exim 3.36 1 (Debian))
	id 1EZhcw-0002nD-00; Tue, 08 Nov 2005 20:32:02 -0800
From: Michael Vogt <mvo@debian.org>
To: 321507-close@bugs.debian.org
X-Katie: $Revision: 1.56 $
Subject: Bug#321507: fixed in python-apt 0.6.14
Message-Id: <E1EZhcw-0002nD-00@spohr.debian.org>
Sender: Archive Administrator <katie@spohr.debian.org>
Date: Tue, 08 Nov 2005 20:32:02 -0800
Delivered-To: 321507-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Source: python-apt
Source-Version: 0.6.14

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

python-apt_0.6.14.dsc
  to pool/main/p/python-apt/python-apt_0.6.14.dsc
python-apt_0.6.14.tar.gz
  to pool/main/p/python-apt/python-apt_0.6.14.tar.gz
python-apt_0.6.14_all.deb
  to pool/main/p/python-apt/python-apt_0.6.14_all.deb
python2.3-apt_0.6.14_i386.deb
  to pool/main/p/python-apt/python2.3-apt_0.6.14_i386.deb
python2.4-apt_0.6.14_i386.deb
  to pool/main/p/python-apt/python2.4-apt_0.6.14_i386.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 321507@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated python-apt 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 ftpmaster@debian.org)


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

Format: 1.7
Date: Wed,  9 Nov 2005 04:52:08 +0100
Source: python-apt
Binary: python2.3-apt python2.4-apt python-apt
Architecture: source all i386
Version: 0.6.14
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description: 
 python-apt - Python interface to libapt-pkg
 python2.3-apt - Python interface to libapt-pkg
 python2.4-apt - Python interface to libapt-pkg
Closes: 321507
Changes: 
 python-apt (0.6.14) unstable; urgency=low
 .
   * doc/examples/build-deps.py:
     - fixed/improved (thanks to Martin Michlmayr, closes: #321507)
   * apt_pkg.Cache.Update() does no longer reopen the cache
     (this is the job of the caller now)
   * python/srcrecords.cc:
     - support for "srcrecords.Files" added
     - always run "Restart" before performing a Lookup
   * export locking via: GetLock(),PkgSystem{Lock,UnLock}
   * apt/cache.py:
     - added  __iter__ to make "for pkg in apt.Cache:" stuff possible
Files: 
 6d64a716a71af5b4e68328cab1f6aa18 703 python optional python-apt_0.6.14.dsc
 a30d3ccb67667f10b1632583db8cc61d 52007 python optional python-apt_0.6.14.tar.gz
 1c65871e2a0db644c4613e8fee040cb5 11876 python optional python-apt_0.6.14_all.deb
 2db9629e91c897d9cb5bc2b085f958c2 65294 python optional python2.3-apt_0.6.14_i386.deb
 cc2f227e5f6143a3f9f4b0dc5a529fd5 65290 python optional python2.4-apt_0.6.14_i386.deb

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

iD8DBQFDcXkyliSD4VZixzQRAixWAJsEpk7nAFcPfpYUcjXZHRTjUqNHnACghICx
nLWEOmW+NlFW62i55DjeKZw=
=jAwS
-----END PGP SIGNATURE-----



Reply to: