[Pkg-privacy-commits] [tails-installer] 06/07: Check version of dd (if it supports status=progress)
Intrigeri
intrigeri at moszumanska.debian.org
Wed May 24 15:27:45 UTC 2017
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to tag 3.93.2
in repository tails-installer.
commit 06675b506cfe32d3345e7dad912593181287dec8
Author: Martin Briza <mbriza at redhat.com>
Date: Fri Apr 22 18:00:11 2016 +0200
Check version of dd (if it supports status=progress)
---
liveusb/creator.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 82e34ff..af936b7 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -362,7 +362,16 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
del env[i]
env['LC_ALL'] = 'C'
- cmd = ['dd', 'if=%s'%self.iso, 'of=%s'%drive, 'bs=1M', 'iflag=direct', 'oflag=direct', 'conv=fdatasync', 'status=progress']
+ cmd = ['dd', 'if=%s'%self.iso, 'of=%s'%drive, 'bs=1M', 'iflag=direct', 'oflag=direct', 'conv=fdatasync']
+
+ #check for version of coreutls (for progress reporting)
+ p = subprocess.Popen(['dd', '--version'], stdout=subprocess.PIPE)
+ p.wait()
+ version = p.stdout.readline().strip()
+ if version.startswith('dd (coreutils) ') and version >= 'dd (coreutils) 8.24':
+ cmd.append('status=progress')
+ else:
+ update_function = None
if update_function:
update_function(0.0)
@@ -378,6 +387,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
if update_function:
while dd.poll() is None:
+
buf = dd.stdout.readline()
match = re.search('([0-9]+) bytes', buf)
if match:
--
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