[Tails-dev] Patch Two new easy liveusb-creator tasks

Delete this message

Reply to this message
Author: Andres Gomez Ramirez
Date:  
To: The Tails public development discussion list
Subject: [Tails-dev] Patch Two new easy liveusb-creator tasks
> OK that's another bug: if not self.live.existing_live_os, it tries to
> copy a new liveos without confirmation and without removing tmp.


> FTR, the two bugs discovered when testing this patch are #6437 and
>#6438, that should be easily fixed by anyone who has touched
> liveusb-creator's codebase before. Andres, maybe?


I attached a patch for "Tails Installer sometimes installs files without confirmation" and "Installer fails to "upgrade" a partial Tails installation" (https://labs.riseup.net/code/issues/6437 and https://labs.riseup.net/code/issues/6438).

Cheers,

AndresFrom 5f56da95523efe8d4d1831a7631ea9bc3016c5ef Mon Sep 17 00:00:00 2001
From: kurono <andres.gomez@???>
Date: Thu, 19 Dec 2013 23:32:19 +0100
Subject: [PATCH] Tails Installer sometimes installs files without
confirmation

---
liveusb/gui.py | 51 +++++++++++++++++++++++++--------------------------
1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/liveusb/gui.py b/liveusb/gui.py
index 3c188c5..1fd366f 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -716,33 +716,32 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
                 # let's go on
                 self.confirmed = False
         else:
-            if self.live.existing_liveos():
-                msg = (_("You are going to upgrade Tails on the %(parent_size)s %(vendor)s %(model)s device (%(device)s). "
-                         "Any persistent volume on this device will remain unchanged. "
-                         "Continue?") % {
-                             'vendor': self.live.drive['vendor'],
-                             'model':  self.live.drive['model'],
-                             'device': self.live.drive['device'],
-                             'parent_size':   _format_bytes_in_gb(self.live.drive['parent_size'])
-                         }
-                      )
-                if self.live.existing_overlay() and self.overlaySlider.value():
-                    msg = msg + _("Warning: Creating a new persistent overlay "
-                                  "will delete your existing one.")
-                if self.show_confirmation_dialog(_("Please confirm your device selection"), msg):
-                    # The user has confirmed that they wish to overwrite their
-                    # existing Live OS.  Here we delete it first, in order to
-                    # accurately calculate progress.
-                    self.delete_existing_liveos_confirmed = False
-                    try:
-                        self.live.delete_liveos()
-                    except LiveUSBError, e:
-                        self.status(e.args[0])
-                        #self.live.unmount_device()
-                        self.enable_widgets(True)
-                        return
-                else:
+            msg = (_("You are going to upgrade Tails on the %(parent_size)s %(vendor)s %(model)s device (%(device)s). "
+                     "Any persistent volume on this device will remain unchanged. "
+                     "Continue?") % {
+                         'vendor': self.live.drive['vendor'],
+                         'model':  self.live.drive['model'],
+                         'device': self.live.drive['device'],
+                         'parent_size':   _format_bytes_in_gb(self.live.drive['parent_size'])
+                     }
+                  )
+            if self.live.existing_overlay() and self.overlaySlider.value():
+                msg = msg + _("Warning: Creating a new persistent overlay "
+                              "will delete your existing one.")
+            if self.show_confirmation_dialog(_("Please confirm your device selection"), msg):
+                # The user has confirmed that they wish to overwrite their
+                # existing Live OS.  Here we delete it first, in order to
+                # accurately calculate progress.
+                self.delete_existing_liveos_confirmed = False
+                try:
+                    self.live.delete_liveos()
+                except LiveUSBError, e:
+                    self.status(e.args[0])
+                    #self.live.unmount_device()
+                    self.enable_widgets(True)
                     return
+            else:
+                return


         # Remove the log handler, because our live thread will register its own
         self.live.log.removeHandler(self.handler)
-- 
1.7.9.5