mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Some xwin fixes
This commit is contained in:
parent
d608e1be54
commit
568f80f210
@ -182,7 +182,15 @@ def download(dest_dir, manifest_version=17, manifest_type='release', manifest_pa
|
||||
manifest = open(manifest_path, 'rb').read()
|
||||
else:
|
||||
url = f'https://aka.ms/vs/{manifest_version}/{manifest_type}/channel'
|
||||
manifest = urlopen(url).read()
|
||||
print('Downloading top-level manifest from', url)
|
||||
tm = json.loads(urlopen(url).read())
|
||||
print("Got toplevel manifest for", (tm["info"]["productDisplayVersion"]))
|
||||
for item in tm["channelItems"]:
|
||||
if item.get('type') == "Manifest":
|
||||
url = item["payloads"][0]["url"]
|
||||
print('Downloading actual manifest...')
|
||||
manifest = urlopen(url).read()
|
||||
|
||||
pkgs = Packages(manifest, crt_variant, arch)
|
||||
os.makedirs(dest_dir, exist_ok=True)
|
||||
total = sum(x.size for x in pkgs.files_to_download)
|
||||
|
@ -14,13 +14,13 @@ class XWin(Command):
|
||||
def run(self, opts):
|
||||
if not shutil.which('msiextract'):
|
||||
raise SystemExit('No msiextract found in PATH you may need to install msitools')
|
||||
base = os.path.join(os.path.dirname(self.SRC), 'setup')
|
||||
m = runpy.run_path(os.path.join(base, 'wincross.py'))
|
||||
cache_dir = os.path.join(base, '.build-cache/xwin')
|
||||
base = os.path.dirname(self.SRC)
|
||||
m = runpy.run_path(os.path.join(base, 'setup', 'wincross.py'))
|
||||
cache_dir = os.path.join(base, '.build-cache', 'xwin')
|
||||
if os.path.exists(cache_dir):
|
||||
shutil.rmtree(cache_dir)
|
||||
os.makedirs(cache_dir)
|
||||
m.main(['--dest', cache_dir])
|
||||
m['main'](['--dest', cache_dir])
|
||||
for x in os.listdir(cache_dir):
|
||||
if x != 'root':
|
||||
shutil.rmtree(f'{cache_dir}/{x}')
|
||||
shutil.rmtree(os.path.join(cache_dir, x))
|
||||
|
Loading…
x
Reference in New Issue
Block a user