diff options
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 19 | ||||
| -rwxr-xr-x | DistUpgrade/dist-upgrade.py | 4 |
2 files changed, 16 insertions, 7 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 871d94d1..c45a7da0 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -107,8 +107,10 @@ class DistUpgradeControler(object): self._view.updateStatus(_("Reading cache")) self.cache = None - # specific for the CDROM based upgrade - self.useNetwork = True + try: + self.useNetwork = getattr(self.options,"withNetwork") + except AttributeError: + pass self.aptcdrom = AptCdrom(distUpgradeView, options.cdromPath) # the configuration @@ -139,9 +141,9 @@ class DistUpgradeControler(object): self.openCache() if not self.cache.sanityCheck(self._view): 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: + # 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,"useNetwork"): 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 " @@ -628,7 +630,12 @@ class DistUpgradeControler(object): os.getenv("PATH")) # now exec self again - os.execve(sys.argv[0],sys.argv+["--have-backports"], os.environ) + args = sys.argv+["--have-backports"] + if self.useNetwork: + args.append("--with-network") + else: + args.append("--without-network") + os.execve(sys.argv[0],args, os.environ) # this is the core def edgyUpgrade(self): diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py index 7174ce17..289f0c2e 100755 --- a/DistUpgrade/dist-upgrade.py +++ b/DistUpgrade/dist-upgrade.py @@ -12,7 +12,9 @@ if __name__ == "__main__": parser = OptionParser() 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("-b", "--have-backports", dest="haveBackports", + 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) (options, args) = parser.parse_args() |
