Comment 4 for bug 1725359

Revision history for this message
Julian Andres Klode (juliank) wrote :

I think we need something like that:

=== modified file 'DistUpgrade/DistUpgradeController.py'
--- DistUpgrade/DistUpgradeController.py 2018-01-29 09:43:48 +0000
+++ DistUpgrade/DistUpgradeController.py 2018-02-07 10:01:22 +0000
@@ -772,6 +772,17 @@
         logging.debug("updateSourcesList()")
         self.sources = SourcesList(matcherPath=self.datadir)
         # backup first!
+
+ if not any(e.dist == self.fromDist for e in self.sources):
+ res = self._view.askYesNoQuestion(_("No valid sources.list entry found"),
+ _("While scanning your repository "
+ "information no entry about %s could be "
+ "found.\n\n"
+ "An upgrade might not succeed.\n\n"
+ "Do you want to continue anyway?" % self.fromDist)
+ if not res:
+ self.abort()
+
         self.sources.backup(self.sources_backup_ext)
         if not self.rewriteSourcesList(mirror_check=True):
             logging.error("No valid mirror found")

It might be a bit too stupid, though.