[Pkg-privacy-commits] [tails-installer] 24/70: Feature 9005:

Ulrike Uhlig ulrike at moszumanska.debian.org
Mon Nov 20 14:54:54 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to annotated tag tails-installer_4.20
in repository tails-installer.

commit 9671c3eff2aab80aec612f84a46e6a548f407138
Author: Tails developers <amnesia at boum.org>
Date:   Fri Apr 22 16:58:03 2016 +0200

    Feature 9005:
    
    Detect when a device has a persistent encrypted partition.
    Also keep that data when the user decides that way.
---
 tails_installer/gui.py | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 08db31e..28a9226 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -296,7 +296,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
         self.source_available = False
         self.target_available = False
         self.target_selected  = False
-        self.persistence = False
+        self.device_with_persistence = []
 
         if self.opts.unprivileged == None:
             self.opts.unprivileged = True
@@ -428,15 +428,17 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
         drive = self.get_selected_drive()
         device = self.live.drives[drive]
 
-        # If device has any valid recognized Tails partition
+        # If device has not any valid recognized Tails partition
         if not self.live.device_can_be_upgraded(device):
-           self.opts.partition = True
+            self.opts.partition = True
         else:
             # If there is persistence upgrade without deleting it
-            if self.persistence:
+            if device['parent'] in self.device_with_persistence:
                 self.opts.partition = False
+                self.__button_start.set_label('Upgrade Tails device: keep data')
             else:
                 self.opts.partition = True
+                self.__button_start.set_label('Upgrade Tails device: not keep data')
 
     def get_device_pretty_name(self, device):
         size = _format_bytes_in_gb(device['parent_size']
@@ -498,6 +500,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
             else:
                 self.__infobar.set_visible(False)
             self.live.log.debug('drives: %s' % self.live.drives)
+            target_list = []
+            self.device_with_persistence = []
             for device, info in self.live.drives.items():
                 # Skip the device that is the source of the copy
                 if (
@@ -516,7 +520,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                 # Skip LUKS-encrypted partitions
                 if info['fstype'] and info['fstype'] == 'crypto_LUKS':
                     self.live.log.debug('Skipping LUKS-encrypted partition: %s' % info['device'])
-                    self.persistence = True
+                    print info['parent']
+                    self.device_with_persistence.append(info['parent'])
                     continue
                 pretty_name = self.get_device_pretty_name(info)
                 # Skip too small devices, but inform the user
@@ -531,7 +536,10 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                                }
                     self.status(message)
                     continue
-                self.__liststore_target.append([pretty_name, device])
+                target_list.append([pretty_name, device])
+            if len(target_list):
+                for target in target_list:
+                    self.__liststore_target.append(target)
                 self.target_available = True
                 self.__combobox_target.set_active(0)
                 self.update_start_button()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git



More information about the Pkg-privacy-commits mailing list