[Pkg-privacy-commits] [tails-installer] 03/04: Import kurono's feature/9005-Improve-tails-installer at commit 51b15fe as quilt patches (Closes: #14720, #14721, #14722, #14723).

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


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

ulrike pushed a commit to annotated tag tails/5.0.1+dfsg-0tails1+bugfix.14809+feature.9005_1.gbpb0c2be
in repository tails-installer.

commit b0c2be268b2fa0c463cc99f0805767fdbeabf5a4
Author: intrigeri <intrigeri at boum.org>
Date:   Thu Nov 9 14:11:12 2017 +0000

    Import kurono's feature/9005-Improve-tails-installer at commit 51b15fe as quilt patches (Closes: #14720, #14721, #14722, #14723).
---
 ...lected-method-as-predicate.-Fixes-Bug-147.patch | 49 +++++++++++++
 ...Do-not-leak-force_reinstall-to-creator.py.patch | 84 ++++++++++++++++++++++
 ...opiate-name-to-device_with_persistence.-I.patch | 49 +++++++++++++
 ...io_changed-method-a-more-informative-name.patch | 36 ++++++++++
 debian/patches/series                              |  4 ++
 5 files changed, 222 insertions(+)

diff --git a/debian/patches/Define-is_ISO_selected-method-as-predicate.-Fixes-Bug-147.patch b/debian/patches/Define-is_ISO_selected-method-as-predicate.-Fixes-Bug-147.patch
new file mode 100644
index 0000000..d617fde
--- /dev/null
+++ b/debian/patches/Define-is_ISO_selected-method-as-predicate.-Fixes-Bug-147.patch
@@ -0,0 +1,49 @@
+From: kurono <andres.gomez at cern.ch>
+Date: Fri, 29 Sep 2017 17:46:05 +0200
+Subject: Define is_ISO_selected method as predicate. Fixes Bug #14722
+
+---
+ tails_installer/gui.py | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/tails_installer/gui.py b/tails_installer/gui.py
+index c4685d0..5258e36 100755
+--- a/tails_installer/gui.py
++++ b/tails_installer/gui.py
+@@ -426,7 +426,9 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+             self.__filechooserbutton_source_file.set_sensitive(True)
+ 
+     def on_force_reinstall_clicked(self, button):
+-        if not self.is_ISO_selected():
++        # If the user has chosen install from ISO, but no ISO is selected
++        if not self.live.opts.clone and not self.is_ISO_selected():
++            self.warn_ISO_not_selected()
+             return
+         self.force_reinstall = True
+         self.opts.partition = True
+@@ -469,16 +471,17 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+         return pretty_name
+ 
+     def is_ISO_selected(self):
+-        # If the user has chosen install from ISO, but no ISO is selected
+-        if not self.live.opts.clone and not (self.live.source.__class__ == LocalIsoSource):
+-            self.show_confirmation_dialog(_("No ISO image selected"),
+-                                          _("Please select a Tails ISO image."),
+-                                          True)
+-            return False
+-        return True
++        return (self.live.source.__class__ == LocalIsoSource)
++
++    def warn_ISO_not_selected(self):
++        self.show_confirmation_dialog(_("No ISO image selected"),
++                                      _("Please select a Tails ISO image."),
++                                        True)
+ 
+     def on_start_clicked(self, button):
+-        if not self.is_ISO_selected():
++        # If the user has chosen install from ISO, but no ISO is selected
++        if not self.live.opts.clone and not self.is_ISO_selected():
++            self.warn_ISO_not_selected()
+             return
+         self.begin()
+ 
diff --git a/debian/patches/Do-not-leak-force_reinstall-to-creator.py.patch b/debian/patches/Do-not-leak-force_reinstall-to-creator.py.patch
new file mode 100644
index 0000000..af37ebd
--- /dev/null
+++ b/debian/patches/Do-not-leak-force_reinstall-to-creator.py.patch
@@ -0,0 +1,84 @@
+From: kurono <andres.gomez at cern.ch>
+Date: Fri, 13 Oct 2017 17:59:07 +0200
+Subject: Do not leak "force_reinstall" to "creator.py". Instead store the
+ parent's data of valid tails partition in case the use selects the reinstall
+ option. Implements Feature Feature #14720.
+
+---
+ tails_installer/creator.py | 12 +++++++-----
+ tails_installer/gui.py     | 10 +++++-----
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/tails_installer/creator.py b/tails_installer/creator.py
+index 2e8b859..d9db3ea 100755
+--- a/tails_installer/creator.py
++++ b/tails_installer/creator.py
+@@ -88,7 +88,6 @@ class TailsInstallerCreator(object):
+     log = None
+     ext_fstypes = set(['ext2', 'ext3', 'ext4'])
+     valid_fstypes = set(['vfat', 'msdos']) | ext_fstypes
+-    force_reinstall = False
+ 
+     drive = property(fget=lambda self: self.drives[self._drive],
+ 	                     fset=lambda self, d: self._set_drive(d))
+@@ -618,6 +617,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
+                 'parent': None,
+                 'parent_udi': None,
+                 'parent_size': None,
++                'parent_data': None,
+                 'size': drive.props.size,
+                 'mounted_partitions': set(),
+                 'is_device_big_enough_for_installation': True,
+@@ -704,10 +704,12 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
+                 self.drives[data['device']] = data
+ 
+             # Remove parent drives if a valid partition exists
+-            if not self.force_reinstall:
+-                for parent in [d['parent'] for d in self.drives.values()]:
+-                    if parent in self.drives:
+-                        del(self.drives[parent])
++            # This is always made to avoid listing both the devices
++            # and their parents in the gui dropdown list
++            for parent in [d['parent'] for d in self.drives.values()]:
++                if parent in self.drives:
++                    data['parent_data'] = self.drives[parent]
++                    del(self.drives[parent])
+ 
+         self.log.debug(pformat(mounted_parts))
+ 
+diff --git a/tails_installer/gui.py b/tails_installer/gui.py
+index 089f6cc..1f2c919 100755
+--- a/tails_installer/gui.py
++++ b/tails_installer/gui.py
+@@ -193,10 +193,12 @@ class TailsInstallerThread(threading.Thread):
+                 if not self.live.can_read_partition_table():
+                     self.live.log.info('Clearing unreadable partition table.')
+                     self.live.clear_all_partition_tables()
++                # If the user has selected the reinstall
++                # option, we need to change the selected device for its parent
+                 if self.parent.force_reinstall:
+-                    parent = _to_unicode(self.live.drive['parent'])
+-                    self.rescan_devices(force_partitions=False)
+-                    self.live.drive = self.live.drives[parent]['device']
++                    parent_data = self.live.drive['parent_data']
++                    self.live.drives[parent_data['device']] = parent_data
++                    self.live.drive = parent_data['device']
+                     self.live.save_full_drive()
+                 self.live.partition_device()
+                 self.rescan_devices(force_partitions=True)
+@@ -432,7 +434,6 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+             return
+         self.force_reinstall = True
+         self.opts.partition = True
+-        self.live.force_reinstall = True
+         self.__button_force_reinstall.set_visible(False)
+         self.on_start_clicked(button)
+ 
+@@ -450,7 +451,6 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+         if self.live.device_can_be_upgraded(device):
+             self.opts.partition = False
+             self.force_reinstall = False
+-            self.live.force_reinstall = False
+             self.__button_start.set_label(_('Upgrade'))
+             self.__button_force_reinstall.set_visible(True)
+         else:
diff --git a/debian/patches/Give-a-more-appropiate-name-to-device_with_persistence.-I.patch b/debian/patches/Give-a-more-appropiate-name-to-device_with_persistence.-I.patch
new file mode 100644
index 0000000..96dfdb5
--- /dev/null
+++ b/debian/patches/Give-a-more-appropiate-name-to-device_with_persistence.-I.patch
@@ -0,0 +1,49 @@
+From: kurono <andres.gomez at cern.ch>
+Date: Fri, 29 Sep 2017 17:53:39 +0200
+Subject: Give a more appropiate name to device_with_persistence. Implments
+ Feature #14723
+
+---
+ tails_installer/gui.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tails_installer/gui.py b/tails_installer/gui.py
+index 5258e36..089f6cc 100755
+--- a/tails_installer/gui.py
++++ b/tails_installer/gui.py
+@@ -299,7 +299,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+         self.source_available = False
+         self.target_available = False
+         self.target_selected  = False
+-        self.device_with_persistence = []
++        self.devices_with_persistence = []
+         self.force_reinstall = False
+ 
+         if self.opts.unprivileged == None:
+@@ -526,7 +526,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+                 self.__infobar.set_visible(False)
+             self.live.log.debug('drives: %s' % self.live.drives)
+             target_list = []
+-            self.device_with_persistence = []
++            self.devices_with_persistence = []
+             for device, info in self.live.drives.items():
+                 # Skip the device that is the source of the copy
+                 if (
+@@ -545,7 +545,7 @@ 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.device_with_persistence.append(info['parent'])
++                    self.devices_with_persistence.append(info['parent'])
+                     continue
+                 pretty_name = self.get_device_pretty_name(info)
+                 # Skip devices with non-removable bit enabled
+@@ -722,7 +722,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+                 'parent_size': _format_bytes_in_gb(self.live.drive['parent_size']),
+             }
+             persistence_message = ""
+-            if self.device_with_persistence:
++            if self.devices_with_persistence:
+                 persistence_message = _("\n\nThe persistent storage on this USB stick will be preserved.")
+             msg = _("%(description)s%(persistence_message)s") % {
+                 'description': description,
diff --git a/debian/patches/Give-on_radio_changed-method-a-more-informative-name.patch b/debian/patches/Give-on_radio_changed-method-a-more-informative-name.patch
new file mode 100644
index 0000000..e25fb5d
--- /dev/null
+++ b/debian/patches/Give-on_radio_changed-method-a-more-informative-name.patch
@@ -0,0 +1,36 @@
+From: kurono <andres.gomez at cern.ch>
+Date: Thu, 28 Sep 2017 19:27:39 +0200
+Subject: Give "on_radio_changed" method a more informative name:
+ "on_radio_button_source_iso_toggled". Solves Feature #14721.
+
+---
+ data/tails-installer.ui | 2 +-
+ tails_installer/gui.py  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/data/tails-installer.ui b/data/tails-installer.ui
+index a030ead..b71e2a0 100644
+--- a/data/tails-installer.ui
++++ b/data/tails-installer.ui
+@@ -192,7 +192,7 @@
+                     <property name="can_focus">False</property>
+                     <property name="xalign">0</property>
+                     <property name="draw_indicator">True</property>
+-                    <signal name="toggled" handler="on_radio_changed" swapped="no"/>
++                    <signal name="toggled" handler="on_radio_button_source_iso_toggled" swapped="no"/>
+                   </object>
+                   <packing>
+                     <property name="expand">False</property>
+diff --git a/tails_installer/gui.py b/tails_installer/gui.py
+index 0f199fc..c4685d0 100755
+--- a/tails_installer/gui.py
++++ b/tails_installer/gui.py
+@@ -416,7 +416,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
+         rgba.parse(config['branding']['color'])
+         self.__image_header.override_background_color(Gtk.StateFlags.NORMAL, rgba)
+ 
+-    def on_radio_changed(self, radio_button):
++    def on_radio_button_source_iso_toggled(self, radio_button):
+         active_radio = [r for r in radio_button.get_group() if r.get_active()][0]
+         if active_radio.get_label() == "Clone the current Tails":
+             self.opts.clone = True
diff --git a/debian/patches/series b/debian/patches/series
index 8ab109a..0b11bfd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,6 @@
 Drop-obsolete-code-that-breaks-UEFI-boot-on-sticks-instal.patch
 Set-the-partition-type-again-after-settings-its-flags-ref.patch
+Give-on_radio_changed-method-a-more-informative-name.patch
+Define-is_ISO_selected-method-as-predicate.-Fixes-Bug-147.patch
+Give-a-more-appropiate-name-to-device_with_persistence.-I.patch
+Do-not-leak-force_reinstall-to-creator.py.patch

-- 
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