[Pkg-privacy-commits] [tails-installer] 51/70: Feature 9005: allow users to use several USB stik having or not Tails installed.
Ulrike Uhlig
ulrike at moszumanska.debian.org
Mon Nov 20 14:55:00 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 c35316709431e62c818cf6016d215b3d53e7505a
Author: kurono <andres.gomez at cern.ch>
Date: Thu Jun 8 18:22:34 2017 +0200
Feature 9005: allow users to use several USB stik having or not Tails installed.
---
data/tails-installer.ui | 2 +-
tails_installer/creator.py | 12 ++++++++----
tails_installer/gui.py | 3 +++
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/data/tails-installer.ui b/data/tails-installer.ui
index a619a89..fd5c317 100644
--- a/data/tails-installer.ui
+++ b/data/tails-installer.ui
@@ -376,7 +376,7 @@
<child>
<object class="GtkLinkButton" id="check_force_reinstall">
<property name="label" translatable="yes">Reinstall (delete all data)</property>
- <property name="visible">True</property>
+ <property name="visible">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">18</property>
diff --git a/tails_installer/creator.py b/tails_installer/creator.py
index 5c663ab..a3021ea 100755
--- a/tails_installer/creator.py
+++ b/tails_installer/creator.py
@@ -88,6 +88,7 @@ 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))
@@ -665,8 +666,10 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
self.log.debug(pformat(data))
if not force_partitions and self.opts.partition:
+ if self.device_can_be_upgraded(data):
+ self.drives[data['device']] = data
# Add whole drive in partitioning mode
- if data['parent'] is None:
+ elif data['parent'] is None:
# Ensure the device is writable
if block.props.read_only:
self.log.debug(_('Unable to write on %(device)s, skipping.')
@@ -676,9 +679,10 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
else:
self.drives[data['device']] = data
- # Remove parent drives if a valid partition exists
- for parent in [d['parent'] for d in self.drives.values()]:
- if parent in self.drives:
+ # 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])
self.log.debug(pformat(mounted_parts))
diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 49f3047..98fcc0c 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -433,6 +433,7 @@ 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)
@@ -441,6 +442,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
def on_target_changed(self, combobox_target):
# get selected device
+ self.__button_force_reinstall.set_visible(False)
drive = self.get_selected_drive()
if drive == None:
return
@@ -456,6 +458,7 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
elif self.user_force_reinstall:
self.opts.partition = True
self.force_reinstall = True
+ self.live.force_reinstall = True
self.__button_start.set_label('Upgrade')
else:
self.opts.partition = False
--
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