mirror of
https://github.com/paolo-projects/unlocker.git
synced 2025-07-28 08:24:23 +02:00
add arch
This commit is contained in:
parent
3564dcfae7
commit
69b308a8b7
65
gettools.py
65
gettools.py
@ -31,6 +31,8 @@ import tarfile
|
|||||||
import zipfile
|
import zipfile
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
ARCH = 'x86'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# For Python 3.0 and later
|
# For Python 3.0 and later
|
||||||
# noinspection PyCompatibility
|
# noinspection PyCompatibility
|
||||||
@ -125,21 +127,9 @@ def main():
|
|||||||
|
|
||||||
lastVersion = parser.HTMLDATA[-1]
|
lastVersion = parser.HTMLDATA[-1]
|
||||||
|
|
||||||
urlpost15 = url + lastVersion + '/packages/com.vmware.fusion.tools.darwin.zip.tar'
|
|
||||||
urlpre15 = url + lastVersion + '/packages/com.vmware.fusion.tools.darwinPre15.zip.tar'
|
|
||||||
parser.clean()
|
parser.clean()
|
||||||
|
|
||||||
# Download the darwin.iso tgz file
|
urlcoretar = url + lastVersion + '/' + ARCH + '/core/com.vmware.fusion.zip.tar'
|
||||||
print('Retrieving Darwin tools from: ' + urlpost15)
|
|
||||||
try:
|
|
||||||
# Try to get tools from packages folder
|
|
||||||
urlretrieve(urlpost15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
|
|
||||||
|
|
||||||
except:
|
|
||||||
# No tools found, get em from the core tar
|
|
||||||
print('Tools aren\'t here... Be patient while I download and' +
|
|
||||||
' give a look into the core.vmware.fusion.tar file')
|
|
||||||
urlcoretar = url + lastVersion + '/core/com.vmware.fusion.zip.tar'
|
|
||||||
|
|
||||||
# Get the main core file
|
# Get the main core file
|
||||||
try:
|
try:
|
||||||
@ -148,8 +138,6 @@ def main():
|
|||||||
print('Couldn\'t find tools')
|
print('Couldn\'t find tools')
|
||||||
return
|
return
|
||||||
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('Extracting com.vmware.fusion.zip.tar...')
|
print('Extracting com.vmware.fusion.zip.tar...')
|
||||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), 'r')
|
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.zip.tar'), 'r')
|
||||||
tar.extract('com.vmware.fusion.zip', path=convertpath(dest + '/tools/'))
|
tar.extract('com.vmware.fusion.zip', path=convertpath(dest + '/tools/'))
|
||||||
@ -173,53 +161,6 @@ def main():
|
|||||||
print('Tools retrieved successfully')
|
print('Tools retrieved successfully')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Tools have been found, go with the normal way
|
|
||||||
|
|
||||||
# Extract the tar to zip
|
|
||||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'), 'r')
|
|
||||||
tar.extract('com.vmware.fusion.tools.darwin.zip', path=convertpath(dest + '/tools/'))
|
|
||||||
tar.close()
|
|
||||||
|
|
||||||
# Extract the iso and sig files from zip
|
|
||||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'), 'r')
|
|
||||||
cdszip.extract('payload/darwin.iso', path=convertpath(dest + '/tools/'))
|
|
||||||
cdszip.extract('payload/darwin.iso.sig', path=convertpath(dest + '/tools/'))
|
|
||||||
cdszip.close()
|
|
||||||
|
|
||||||
# Move the iso and sig files to tools folder
|
|
||||||
shutil.move(convertpath(dest + '/tools/payload/darwin.iso'), convertpath(dest + '/tools/darwin.iso'))
|
|
||||||
shutil.move(convertpath(dest + '/tools/payload/darwin.iso.sig'), convertpath(dest + '/tools/darwin.iso.sig'))
|
|
||||||
|
|
||||||
# Cleanup working files and folders
|
|
||||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
|
||||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip.tar'))
|
|
||||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwin.zip'))
|
|
||||||
|
|
||||||
# Download the darwinPre15.iso tgz file
|
|
||||||
print('Retrieving DarwinPre15 tools from: ' + urlpre15)
|
|
||||||
urlretrieve(urlpre15, convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))
|
|
||||||
|
|
||||||
# Extract the tar to zip
|
|
||||||
tar = tarfile.open(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'), 'r')
|
|
||||||
tar.extract('com.vmware.fusion.tools.darwinPre15.zip', path=convertpath(dest + '/tools/'))
|
|
||||||
tar.close()
|
|
||||||
|
|
||||||
# Extract the iso and sig files from zip
|
|
||||||
cdszip = zipfile.ZipFile(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'), 'r')
|
|
||||||
cdszip.extract('payload/darwinPre15.iso', path=convertpath(dest + '/tools/'))
|
|
||||||
cdszip.extract('payload/darwinPre15.iso.sig', path=convertpath(dest + '/tools/'))
|
|
||||||
cdszip.close()
|
|
||||||
|
|
||||||
# Move the iso and sig files to tools folder
|
|
||||||
shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso'),
|
|
||||||
convertpath(dest + '/tools/darwinPre15.iso'))
|
|
||||||
shutil.move(convertpath(dest + '/tools/payload/darwinPre15.iso.sig'),
|
|
||||||
convertpath(dest + '/tools/darwinPre15.iso.sig'))
|
|
||||||
|
|
||||||
# Cleanup working files and folders
|
|
||||||
shutil.rmtree(convertpath(dest + '/tools/payload'), True)
|
|
||||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip.tar'))
|
|
||||||
os.remove(convertpath(dest + '/tools/com.vmware.fusion.tools.darwinPre15.zip'))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user