@@ -199,8 +199,8 @@ def release_platform_for_url(archive_url: str) -> str:
199199
200200
201201def get_release_platforms (tool : Tool , release : str ) -> List [str ]:
202- return [release_platform_for_url (url ) for url in
203- get_release_asset_urls (tool , release )]
202+ return [platform for platform in [ release_platform_for_url (url ) for url in
203+ get_release_asset_urls (tool , release )] if "debug" not in platform ]
204204
205205
206206def get_ending (url : str ) -> str :
@@ -211,6 +211,7 @@ def get_ending(url: str) -> str:
211211
212212def download_latest_jattach (dest_path : Path , platform : str ):
213213 """ Download the latest jattach release from GitHub """
214+ print (f"Download latest jattach for { platform } to { dest_path } " )
214215 release = get_most_recent_release (Tool .JATTACH )
215216 urls = get_release_asset_urls (Tool .JATTACH , release )
216217 url = ([url for url in urls if
@@ -236,6 +237,7 @@ def download_release_url(release: str, release_url: str):
236237 os .makedirs (dest_folder , exist_ok = True )
237238 ending = get_ending (release_url )
238239 platform = release_platform_for_url (release_url )
240+ print (f"Download { release } for { platform } from { release_url } " )
239241 archive_file = f"{ dest_folder } /async-profiler-{ release } -{ platform } { ending } "
240242 if not os .path .exists (archive_file ):
241243 request .urlretrieve (release_url , archive_file )
@@ -246,11 +248,11 @@ def download_release_url(release: str, release_url: str):
246248 else :
247249 raise Exception ("Unknown archive type for " + release_url )
248250 # if dest-folder doesn't contain jattach for this platform, download it
249- if not os . path . exists (
250- f" { dest_folder } /async-profiler- { release } - { platform } /build/ jattach" ):
251- download_latest_jattach ( Path (
252- f" { dest_folder } /async-profiler- { release } - { platform } /build/ jattach" ),
253- platform )
251+ jattach = f" { dest_folder } /async-profiler- { release } - { platform } /build/jattach"
252+ if not os . path . exists ( jattach ):
253+ print ( f"jattach not found in { jattach } , downloading it" )
254+ download_latest_jattach ( Path ( jattach ), platform )
255+ assert os . path . exists ( jattach ), "jattach not found in " + jattach
254256
255257
256258def download_release_code (release : str ):
@@ -270,6 +272,8 @@ def download_release_code(release: str):
270272
271273def download_release (release : str ):
272274 for release_url in get_release_asset_urls (Tool .ASYNC_PROFILER , release ):
275+ if "debug" in release_url :
276+ continue
273277 download_release_url (release , release_url )
274278 download_release_code (release )
275279
@@ -564,4 +568,4 @@ def cli():
564568
565569
566570if __name__ == "__main__" :
567- cli ()
571+ cli ()
0 commit comments