~kdeneon/ubuntu-release-upgrader-neon/trunk

« back to all changes in this revision

Viewing changes to DistUpgrade/DistUpgradeController.py

  • Committer: Jonathan Riddell
  • Date: 2019-03-08 11:14:29 UTC
  • Revision ID: jriddell@ubuntu.com-20190308111429-7978lfyutyy0xhqq
update to 18.04.30 from patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
        # ConfigParser deals only with strings it seems *sigh*
132
132
        self.config.add_section("Options")
133
133
        self.config.set("Options","withNetwork", str(self.useNetwork))
 
134
        if self.options:
 
135
            if self.options.devel_release:
 
136
                self.config.set("Options","devRelease", "True")
 
137
            else:
 
138
                self.config.set("Options","devRelease", "False")
134
139
 
135
140
        # some constants here
136
141
        self.fromDist = self.config.get("Sources","From")
535
540
                        distro.get_sources(self.sources)
536
541
                        distro.enable_component("main")
537
542
                        main_was_missing = True
 
543
                        logging.debug('get_distro().enable_component("main") succeeded')
538
544
                    except NoDistroTemplateException as e:
539
545
                        logging.exception('NoDistroTemplateException raised: %s' % e)
540
546
                        # fallback if everything else does not work,
680
686
                    foundToDist |= validTo
681
687
                elif entry.dist in fromDists:
682
688
                    foundToDist |= validTo
683
 
                    entry.dist = toDists[fromDists.index(entry.dist)]
684
 
                    logging.debug("entry '%s' updated to new dist" % get_string_with_no_auth_from_source_entry(entry))
 
689
                    # check to see whether the archive provides the new dist
 
690
                    test_entry = copy.copy(entry)
 
691
                    test_entry.dist = self.toDist
 
692
                    if not self._sourcesListEntryDownloadable(test_entry):
 
693
                        entry.disabled = True
 
694
                        self.sources_disabled = True
 
695
                        logging.debug("entry '%s' was disabled (no Release file)" % get_string_with_no_auth_from_source_entry(entry))
 
696
                    else:
 
697
                        entry.dist = toDists[fromDists.index(entry.dist)]
 
698
                        logging.debug("entry '%s' updated to new dist" % get_string_with_no_auth_from_source_entry(entry))
685
699
                elif entry.type == 'deb-src':
686
700
                    continue
687
701
                elif validMirror:
933
947
        # compare the list after the update again
934
948
        self.obsolete_pkgs = self.cache._getObsoletesPkgs()
935
949
        self.foreign_pkgs = self.cache._getForeignPkgs(self.origin, self.fromDist, self.toDist)
 
950
        # If a PPA has already been disabled the pkgs won't be considered
 
951
        # foreign
 
952
        if len(self.foreign_pkgs) > 0:
 
953
            self.config.set("Options","foreignPkgs", "True")
 
954
        else:
 
955
            self.config.set("Options","foreignPkgs", "False")
936
956
        if self.serverMode:
937
957
            self.tasks = self.cache.installedTasks
938
958
        logging.debug("Foreign: %s" % " ".join(sorted(self.foreign_pkgs)))
1486
1506
                self._view.getTerminal().call([script], hidden=True)
1487
1507
            except Exception as e:
1488
1508
                logging.error("got error from PostInstallScript %s (%s)" % (script, e))
1489
 
        
 
1509
 
1490
1510
    def abort(self):
1491
1511
        """ abort the upgrade, cleanup (as much as possible) """
1492
1512
        logging.debug("abort called")
1518
1538
                    return True
1519
1539
        logging.error("depends '%s' is not satisfied" % depstr)
1520
1540
        return False
1521
 
                
 
1541
 
1522
1542
    def checkViewDepends(self):
1523
1543
        " check if depends are satisfied "
1524
1544
        logging.debug("checkViewDepends()")
1537
1557
                                 _("The required dependency '%s' is not "
1538
1558
                                   "installed. " % dep))
1539
1559
                sys.exit(1)
1540
 
        return res 
 
1560
        return res
1541
1561
 
1542
1562
    def _verifyBackports(self):
1543
1563
        # run update (but ignore errors in case the countrymirror