[Pkg-privacy-commits] [tails-installer] 15/35: More improvements to the maximum overlay size code

anonym anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:14:41 UTC 2017


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

anonym-tails-guest pushed a commit to annotated tag 3.12.0
in repository tails-installer.

commit ff88f95b6e427b45898b228756dbdaa3df953cb5
Author: Luke Macken <lmacken at redhat.com>
Date:   Fri Mar 1 17:14:21 2013 -0500

    More improvements to the maximum overlay size code
---
 liveusb/gui.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/liveusb/gui.py b/liveusb/gui.py
index 537f141..fb0d677 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -50,6 +50,7 @@ except:
 
 MAX_FAT16 = 2047
 MAX_FAT32 = 3999
+MAX_EXT = 2097152
 
 
 class LiveUSBApp(QtGui.QApplication):
@@ -400,7 +401,8 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
                 return
 
         device = self.live.drives[drive]
-        freespace = device['free'] or 0
+        freespace = device['free']
+        device_size = device['size'] / 1024**2
         current_overlay = self.overlaySlider.value()
 
         if device['fsversion'] == 'FAT32':
@@ -412,21 +414,23 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
                                     'size to 2G'))
             max_space = MAX_FAT16
         else:
-            max_space = freespace
+            max_space = MAX_EXT
+
+        if freespace:
+            if freespace > device_size:
+                freespace = device_size
+            if freespace > max_space:
+                freespace = max_space
 
         if not device['mount']:
             self.live.log.warning(_('Device is not yet mounted, so we cannot '
                                     'determine the amount of free space.'))
-            if freespace > max_space:
-                freespace = max_space
+            if not freespace:
+                freespace = device_size
         else:
             if not freespace:
                 self.live.log.warning(_('No free space on %s') % drive)
                 freespace = 0
-            else:
-                if device['fsversion'] in ('FAT32', 'FAT16'):
-                    if freespace > max_space:
-                        freespace = max_space
 
         # Subtract the size of the ISO from our maximum overlay size
         if self.live.isosize:

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