refs #1101 improve ogGetImageInfo() a bit

pull/1/head
Natalia Serrano 2024-11-12 11:56:56 +01:00
parent b668a526b0
commit 38cb5ab986
1 changed files with 12 additions and 16 deletions

View File

@ -236,24 +236,20 @@ def ogGetImageInfo (imgfile):
if 'size' in partclone_info:
tools = 'PARTCLONE'
sizefactor = 1000000 if 'GB' in partclone_info else 1024
m = re.search (r'File system *: *(\S+)', partclone_info)
fs = m.group(1) if m else ''
if fs in ['HFS', 'HFSPLUS', 'FAT32']:
## TODO
#FSPLUS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($9);}')
fsplus = 'PLUS'
if fsplus:
fs += fsplus ## 'HFS' -> 'HFSPLUS'
size = 42
else:
size = 42
## /TODO
size = int (size * sizefactor)
else:
m = re.search (r'Device size *: *(\S+)', partclone_info)
size = float (m.group(1)) if m else 0
size = int (size * sizefactor)
sizefactor = 1000000 if 'GB' in partclone_info else 1024
m = re.search (r'Device size *: *(\S+)', partclone_info)
size = float (m.group(1)) if m else 0
size = int (size * sizefactor)
## why is this?
#if fs in ['HFS', 'HFSPLUS', 'FAT32']:
# #FSPLUS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($9);}')
# fsplus = 'PLUS'
# if fsplus: # fs += fsplus ## 'HFS' -> 'HFSPLUS'
imgdetect = True
if False == imgdetect and not os.path.exists ('/dev/loop2'):