~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to debian/update-manager-downloader-fix2.diff

  • Committer: Balint Reczey
  • Date: 2020-06-11 18:46:02 UTC
  • Revision ID: balint.reczey@canonical.com-20200611184602-2rv1zan3xu723x2u
Moved to git at https://git.launchpad.net/update-notifier

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'UpdateManager/Core/DistUpgradeFetcherCore.py'
2
 
--- UpdateManager/Core/DistUpgradeFetcherCore.py        2011-07-15 15:32:30 +0000
3
 
+++ UpdateManager/Core/DistUpgradeFetcherCore.py        2011-11-01 13:22:16 +0000
4
 
@@ -68,12 +68,9 @@
5
 
             f = self.tmpdir+"/"+os.path.basename(self.new_dist.upgradeTool)
6
 
             sig = self.tmpdir+"/"+os.path.basename(self.new_dist.upgradeToolSig)
7
 
             print "authenticate '%s' against '%s' " % (os.path.basename(f),os.path.basename(sig))
8
 
-            if not self.gpgauthenticate(f, sig):
9
 
-                return False
10
 
-
11
 
-        # we may return False here by default if we want to make a sig
12
 
-        # mandatory
13
 
-        return True
14
 
+            if self.gpgauthenticate(f, sig):
15
 
+                return True
16
 
+        return False
17
 
 
18
 
     def gpgauthenticate(self, file, signature,
19
 
                         keyring='/etc/apt/trusted.gpg'):
20
 
@@ -249,6 +246,12 @@
21
 
                   _("Fetching the upgrade failed. There may be a network "
22
 
                     "problem. "))
23
 
             return
24
 
+        if not self.authenticate():
25
 
+            self.error(_("Authentication failed"),
26
 
+                  _("Authenticating the upgrade failed. There may be a problem "
27
 
+                    "with the network or with the server. "))
28
 
+            self.cleanup()
29
 
+            return
30
 
         if not self.extractDistUpgrader():
31
 
             self.error(_("Failed to extract"),
32
 
                   _("Extracting the upgrade failed. There may be a problem "
33
 
@@ -261,12 +264,6 @@
34
 
                     "with the network or with the server. "))
35
 
             self.cleanup()
36
 
             return
37
 
-        if not self.authenticate():
38
 
-            self.error(_("Authentication failed"),
39
 
-                  _("Authenticating the upgrade failed. There may be a problem "
40
 
-                    "with the network or with the server. "))
41
 
-            self.cleanup()
42
 
-            return
43
 
         try:
44
 
             # check if we can execute, if we run it via sudo we will
45
 
             # not know otherwise, sudo/gksu will not raise a exception
46