summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-11-10 11:37:22 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2008-11-10 11:37:22 +0100
commit2ffb67326afc5a404e14e4fa1cb57f341e9fea94 (patch)
treecd3dcc8c3e164b65f4b23e43b90ed225d829b1ac /doc/examples
parent01582092da5613022a4ef43751f38306957c7480 (diff)
parent969986c30b34fc47b47a9ca2c9e1cd6ab38fe5ea (diff)
downloadpython-apt-2ffb67326afc5a404e14e4fa1cb57f341e9fea94.tar.gz
* python/metaindex.cc
- fix crash when incorrect attribute is given * data/templates/Ubuntu.info.in: - updated to fix ports.ubuntu.com for powerpc and lpia (LP: #220890) * aptsources/distro.py: - add parameter to get_distro() to make unit testing easier * tests/test_aptsources_ports.py: - add test for arch specific handling (when sub arch is on a different mirror than "main" arches) * python/acquire.cc (GetPkgAcqFile): Support DestDir and DestFilename.
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/acquire.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/doc/examples/acquire.py b/doc/examples/acquire.py
index 1291dbfa..eef6c1f7 100644
--- a/doc/examples/acquire.py
+++ b/doc/examples/acquire.py
@@ -5,24 +5,13 @@ import sys
import tempfile
def get_file(fetcher, uri, destFile):
- cwd = os.getcwd()
- # create a temp dir
- dir = tempfile.mkdtemp()
- os.chdir(dir)
# get the file
af = apt_pkg.GetPkgAcqFile(fetcher,
uri=uri,
- descr="sample descr")
+ descr="sample descr", destFile=destFile)
res = fetcher.Run()
if res != fetcher.ResultContinue:
- os.rmdir(dir)
- os.chdir(cwd)
return False
- filename = os.path.basename(uri)
- os.rename(dir+"/"+filename,destFile)
- # cleanup
- os.rmdir(dir)
- os.chdir(cwd)
return True
apt_pkg.init()