From ba58baea53b70a3a6604c2671b7a97585d7dbd3d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 23 Sep 2006 00:12:57 +0200 Subject: * DistUpgrade/DistUpgradeControler.py: - get the with,without-network argument passing right --- DistUpgrade/DistUpgradeControler.py | 8 ++++++-- DistUpgrade/dist-upgrade.py | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'DistUpgrade') 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"): -- cgit v1.2.3