Count the files in the squashfs image without piping to wc -l.
This commit is contained in:
parent
cb2dcf7860
commit
f44b8eb758
@ -59,10 +59,8 @@ class UnsquashOperation:
|
|||||||
try:
|
try:
|
||||||
for entry in self.unpacklist:
|
for entry in self.unpacklist:
|
||||||
try:
|
try:
|
||||||
unsqfsProcess = subprocess.Popen( [ "unsquashfs", "-l", entry[ "source" ] ], stdout = subprocess.PIPE )
|
sqfsList = subprocess.check_output( [ "unsquashfs", "-l", entry[ "source" ] ] )
|
||||||
wcProcess = subprocess.Popen( [ "wc", "-l" ], stdin = unsqfsProcess.stdout, stdout = subprocess.PIPE )
|
filesCount = sqfsList.splitlines().count()
|
||||||
countString = wcProcess.communicate()[ 0 ]
|
|
||||||
filesCount = int( float( countString ) )
|
|
||||||
self.unpackstatus[ entry[ "source" ] ][ 'total' ] = filesCount
|
self.unpackstatus[ entry[ "source" ] ][ 'total' ] = filesCount
|
||||||
|
|
||||||
imgBaseName = os.path.splitext( os.path.basename( entry[ "source" ] ) )[ 0 ]
|
imgBaseName = os.path.splitext( os.path.basename( entry[ "source" ] ) )[ 0 ]
|
||||||
|
Loading…
Reference in New Issue
Block a user