diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-22 12:29:11 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-22 12:29:11 +0200 |
| commit | 9d4b2d3c59f133b79f25959a9e34a4255ab0447b (patch) | |
| tree | 028db3f9dffeb0a5aaf30e92f9717e2734258df4 /DistUpgrade | |
| parent | 040c4c726d15962c942f0b286299da2c48e9bccb (diff) | |
| download | python-apt-9d4b2d3c59f133b79f25959a9e34a4255ab0447b.tar.gz | |
* DistUpgrade/DistUpgradeControler.py:
- do not mark the backports for install and use the PM interface but the
apt_pkg.GetPkgAcqFile() so that we don't have to worry about dependencies
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 19babaa3..0ae879dc 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -566,30 +566,41 @@ class DistUpgradeControler(object): apt_pkg.Config.Set("Dir::Cache::archives",backportsdir) # mark the backports for upgrade and get them - pm = apt_pkg.GetPackageManager(self.cache._depcache) fetcher = apt_pkg.GetAcquire(self._view.getFetchProgress()) - # FIXME: add a version line to the cfg file to make sure # we get the right version file! for pkgname in self.config.getlist("Backports","Packages"): - self.cache[pkgname].markInstall() - pm.GetArchives(fetcher,self.cache._list,self.cache._records) + pkg = self.cache[pkgname] + pkg._lookupRecord(True) + path = apt_pkg.ParseSection(pkg._records.Record)["Filename"] + cand = pkg._depcache.GetCandidateVer(pkg._pkg) + for (packagefile,i) in cand.FileList: + indexfile = self.cache._list.FindIndex(packagefile) + if indexfile: + uri = indexfile.ArchiveURI(path) + apt_pkg.GetPkgAcqFile(fetcher, uri=uri, + descr=_("Fetching backport of '%s'" % pkgname)) + res = fetcher.Run() + if res != fetcher.ResultContinue: + # ick! error ... + return False # reset the cache dir apt_pkg.Config.Set("Dir::Cache::archives",cachedir) - - self.setupRequiredBackports(backportsdir) + return self.setupRequiredBackports(backportsdir) def setupRequiredBackports(self, backportsdir): " setup the required backports in a evil way " backportsdir = os.path.normpath(backportsdir) # unpack it for deb in glob.glob(backportsdir+"*.deb"): - os.system("dpkg-deb -x %s %s" % (deb, backportsdir)) + ret = os.system("dpkg-deb -x %s %s" % (deb, backportsdir)) + # FIXME: do error checking # setup some pathes to make sure the new stuff is used os.putenv("LD_LIBRARY_PATH",os.path.join(backportsdir,"/usr/lib")) os.putenv("PYTHONPATH",os.path.join(backportsdir,"/usr/lib/python2.4/")) os.putenv("PATH","%s:%s" % (os.path.join(backportsdir,"/usr/bin"),os.getenv("PATH"))) + return True # this is the core def edgyUpgrade(self): |
