diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-23 00:12:57 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-23 00:12:57 +0200 |
| commit | ba58baea53b70a3a6604c2671b7a97585d7dbd3d (patch) | |
| tree | 7292fa9c869d2f7cf61bce493826c435f70b3fc9 /DistUpgrade | |
| parent | bd5dc1971ab94c31d721d0df442b41e3eab2aca0 (diff) | |
| download | python-apt-ba58baea53b70a3a6604c2671b7a97585d7dbd3d.tar.gz | |
* DistUpgrade/DistUpgradeControler.py:
- get the with,without-network argument passing right
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 8 | ||||
| -rwxr-xr-x | DistUpgrade/dist-upgrade.py | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 2d36e9cc..bcb54553 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -107,7 +107,10 @@ class DistUpgradeControler(object): self._view.updateStatus(_("Reading cache")) self.cache = None - self.useNetwork = getattr(self.options,"withNetwork",True) + if self.options.withNetwork == None: + self.useNetwork = True + else: + self.useNetwork = self.options.withNetwork self.aptcdrom = AptCdrom(distUpgradeView, options.cdromPath) # the configuration @@ -140,7 +143,7 @@ class DistUpgradeControler(object): return False # FIXME: we may try to find out a bit more about the network # connection here and ask more inteligent questions - if self.aptcdrom and not hasattr(self.options, "witheNetwork"): + if self.aptcdrom and self.options.withNetwork == None: res = self._view.askYesNoQuestion(_("Fetch data from the network for the upgrade?"), _("The upgrade can use the network to check " "the latest updates and to fetch packages that are not on the " @@ -602,6 +605,7 @@ class DistUpgradeControler(object): if match: uri = match.group(1) + path apt_pkg.GetPkgAcqFile(fetcher, uri=uri, + size=ver.Size, descr=_("Fetching backport of '%s'" % pkgname)) res = fetcher.Run() if res != fetcher.ResultContinue: diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py index 289f0c2e..918dff02 100755 --- a/DistUpgrade/dist-upgrade.py +++ b/DistUpgrade/dist-upgrade.py @@ -13,9 +13,8 @@ if __name__ == "__main__": parser.add_option("-c", "--cdrom", dest="cdromPath", default=None, help="Use the given path to search for a cdrom with upgradable packages") parser.add_option("--with-network", dest="withNetwork",action="store_true") - parser.add_option("--without-network", dest="withNetwork",action="store_false") - parser.add_option("--have-backports", dest="haveBackports", - action="store_true",default=False) + parser.add_option("--without-network", dest="withNetwork",action="store_false", default=True) + parser.add_option("--have-backports", dest="haveBackports", action="store_true") (options, args) = parser.parse_args() if not os.path.exists("/var/log/dist-upgrade"): |
