[Pkg-privacy-commits] [tails-installer] 11/24: Pull the ldlinux-specific code out into it's own method, and call it elsewhere.

anonym anonym-tails-guest at moszumanska.debian.org
Thu Jan 12 15:14:46 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.1
in repository tails-installer.

commit 6ecd8af4b6f5e98542434b666c97a73622bbee20
Author: Luke Macken <lmacken at redhat.com>
Date:   Thu Dec 12 13:44:20 2013 -0700

    Pull the ldlinux-specific code out into it's own method, and call it elsewhere.
---
 liveusb/creator.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/liveusb/creator.py b/liveusb/creator.py
index b3bdffc..4b4da76 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -324,9 +324,20 @@ class LiveUSBCreator(object):
                 except Exception, e:
                     self.log.warning(_("Unable to copy %s to %s: %s") % (infile, outfile, str(e)))
 
+    def delete_ldlinux(self):
+        # Don't prompt about overwriting files from mtools (#491234)
+        for ldlinux in [os.path.join(self.dest, p, 'ldlinux.sys')
+                        for p in ('syslinux', '')]:
+            self.log.debug('Looking for %s' % ldlinux)
+            if os.path.isfile(ldlinux):
+                self.log.debug(_("Removing") + " %s" % ldlinux)
+                self.popen('chattr -i "%s"' % ldlinux, passive=True)
+                os.unlink(ldlinux)
+
     def delete_liveos(self):
         """ Delete the existing LiveOS """
         self.log.info(_('Removing existing Live OS'))
+        self.delete_ldlinux()
         for path in [self.get_liveos(),
                      os.path.join(self.dest + os.path.sep, 'syslinux'),
                      os.path.join(self.dest + os.path.sep, 'isolinux')]:
@@ -708,14 +719,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
             if copied:
                 break
 
-        # Don't prompt about overwriting files from mtools (#491234)
-        for ldlinux in [os.path.join(self.dest, p, 'ldlinux.sys')
-                        for p in ('syslinux', '')]:
-            self.log.debug('Looking for %s' % ldlinux)
-            if os.path.isfile(ldlinux):
-                self.log.debug(_("Removing") + " %s" % ldlinux)
-                self.popen('chattr -i "%s"' % ldlinux, passive=True)
-                os.unlink(ldlinux)
+        self.delete_ldlinux()
 
         if self.drive['fstype'] in self.ext_fstypes:
             shutil.move(os.path.join(syslinux_path, "syslinux.cfg"),

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