Bug#629624: python-apt: acquire.run() should fail when the lists/partial directory is missing

2012-06-19 Thread Julian Andres Klode
On Wed, Jun 08, 2011 at 10:12:39AM +0200, Raphaël Hertzog wrote:
 Package: python-apt
 Version: 0.8.0
 Severity: normal
 
 Consider the following code:
 import sys
 import apt_pkg
 
 apt_pkg.init_config()
 apt_pkg.config[Dir::Etc] = 
 /home/rhertzog/deb/core/rolling/sat-britney/apt-etc
 apt_pkg.config[Dir::State] = 
 /home/rhertzog/deb/core/rolling/sat-britney/apt-state
 apt_pkg.config[Dir::Cache] = 
 /home/rhertzog/deb/core/rolling/sat-britney/apt-cache
 apt_pkg.init_system()
 
 acquire = apt_pkg.Acquire()
 srclist = apt_pkg.SourceList()
 if not srclist.read_main_list():
 sys.stdout.write(Failed to read sources.list)
 if srclist.get_indexes(acquire, True):
 sys.stdout.write(Update OK\n)
 else:
 sys.stdout.write(Update failed\n)
 res = acquire.run()
 if res == apt_pkg.Acquire.RESULT_CONTINUE:
 sys.stdout.write(Download OK\n)
 else:
 sys.stdout.write(Download failed\n)
 
 I have a created a simple sources.list in Dir::Etc (listing an http:// URL) 
 but
 I'm missing a partial directory in Dir::State::lists. The code will execute
 without errors but no files will be downloaded.
 
 Either it should auto-create the partial sub-dir or it should fail
 with a proper error/exception. The current behavior is sub-optimal.

Fixed in revision 609.

Traceback (most recent call last):
  File a.py, line 11, in module
acquire = apt_pkg.Acquire()
SystemError: E:List directory 
/home/rhertzog/deb/core/rolling/sat-britney/apt-state/lists/partial is missing. 
- Acquire (2: No such file or directory)

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#629624: python-apt: acquire.run() should fail when the lists/partial directory is missing

2011-06-08 Thread Raphaël Hertzog
Package: python-apt
Version: 0.8.0
Severity: normal

Consider the following code:
import sys
import apt_pkg

apt_pkg.init_config()
apt_pkg.config[Dir::Etc] = 
/home/rhertzog/deb/core/rolling/sat-britney/apt-etc
apt_pkg.config[Dir::State] = 
/home/rhertzog/deb/core/rolling/sat-britney/apt-state
apt_pkg.config[Dir::Cache] = 
/home/rhertzog/deb/core/rolling/sat-britney/apt-cache
apt_pkg.init_system()

acquire = apt_pkg.Acquire()
srclist = apt_pkg.SourceList()
if not srclist.read_main_list():
sys.stdout.write(Failed to read sources.list)
if srclist.get_indexes(acquire, True):
sys.stdout.write(Update OK\n)
else:
sys.stdout.write(Update failed\n)
res = acquire.run()
if res == apt_pkg.Acquire.RESULT_CONTINUE:
sys.stdout.write(Download OK\n)
else:
sys.stdout.write(Download failed\n)

I have a created a simple sources.list in Dir::Etc (listing an http:// URL) but
I'm missing a partial directory in Dir::State::lists. The code will execute
without errors but no files will be downloaded.

Either it should auto-create the partial sub-dir or it should fail
with a proper error/exception. The current behavior is sub-optimal.

Cheers,

-- System Information:
Debian Release: wheezy/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (150, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-apt depends on:
ii  apt [libapt-pkg4.10] 0.8.14.1Advanced front-end for dpkg
ii  apt-utils [libapt-inst1.2]   0.8.14.1APT utility programs
ii  libc62.13-5  Embedded GNU C Library: Shared lib
ii  libgcc1  1:4.6.0-11  GCC support library
ii  libstdc++6   4.6.0-11The GNU Standard C++ Library v3
ii  python   2.6.6-14interactive high-level object-orie
ii  python-apt-common0.8.0   Python interface to libapt-pkg (lo
ii  python2.62.6.6-10An interactive high-level object-o
ii  python2.72.7.2~rc1-2 An interactive high-level object-o

Versions of packages python-apt recommends:
ii  iso-codes 3.26-1 ISO language, territory, currency,
ii  lsb-release   3.2-27 Linux Standard Base version report
ii  python2.6 2.6.6-10   An interactive high-level object-o

Versions of packages python-apt suggests:
pn  python-apt-dbgnone (no description available)
ii  python-apt-doc0.8.0  Python interface to libapt-pkg (AP
ii  python-gtk2   2.24.0-2   Python bindings for the GTK+ widge
ii  python-vte1:0.28.0-2 Python bindings for the VTE widget

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org