@@ -32,6 +32,12 @@ class CtInstaller(ProtonGECtInstaller):
32
32
CT_URL = 'https://api.github.com/repos/CachyOS/proton-cachyos/releases'
33
33
CT_INFO_URL = 'https://github.com/CachyOS/proton-cachyos/releases/tag/'
34
34
35
+ def __init__ (self , main_window = None ) -> None :
36
+
37
+ super ().__init__ (main_window )
38
+
39
+ self .release_format = 'tar.xz'
40
+
35
41
def __fetch_github_data (self , tag : str , arch : str ) -> dict | None :
36
42
"""
37
43
Fetch GitHub release information
@@ -91,49 +97,23 @@ def fetch_releases(self, count: int = 100, page: int = 1) -> list:
91
97
assets .append (name )
92
98
return assets
93
99
94
- def get_tool (self , version : str , install_dir : str , temp_dir : str ):
100
+ def __get_data (self , version : str , install_dir : str ) -> tuple [dict | None , str | None ]:
101
+
95
102
"""
96
- Download and install the compatibility tool
97
- Return Type: bool
103
+ Get needed download data and path to extract directory.
104
+ Return Type: tuple[dict | None, str | None]
98
105
"""
106
+
99
107
major , minor , arch = version .split ("-" )
100
108
tag = "-" .join (('cachyos' , major , minor , 'slr' ))
101
109
data = self .__fetch_github_data (tag , arch )
102
110
103
111
if not data or 'download' not in data :
104
- return False
112
+ return ( None , None )
105
113
106
114
protondir = os .path .join (install_dir , data ['version' ])
107
- if not os .path .exists (protondir ):
108
- protondir = os .path .join (install_dir , 'proton-' + data ['version' ])
109
- checksum_dir = f'{ protondir } /sha512sum'
110
- source_checksum = self .rs .get (data ['checksum' ]).text if 'checksum' in data else None
111
- local_checksum = open (checksum_dir ).read () if os .path .exists (checksum_dir ) else None
112
-
113
- if os .path .exists (protondir ):
114
- if local_checksum and source_checksum :
115
- if local_checksum in source_checksum :
116
- return False
117
- else :
118
- return False
119
-
120
- proton_tar = os .path .join (temp_dir , data ['download' ].split ('/' )[- 1 ])
121
- if not self .__download (url = data ['download' ], destination = proton_tar , known_size = data .get ('size' , 0 )):
122
- return False
123
-
124
- download_checksum = self .__sha512sum (proton_tar )
125
- if source_checksum and (download_checksum not in source_checksum ):
126
- return False
127
-
128
- if not extract_tar (proton_tar , install_dir , mode = 'xz' ):
129
- return False
130
-
131
- if os .path .exists (checksum_dir ):
132
- open (checksum_dir , 'w' ).write (download_checksum )
133
-
134
- self .__set_download_progress_percent (100 )
135
115
136
- return True
116
+ return ( data , protondir )
137
117
138
118
def get_info_url (self , version : str ) -> str :
139
119
"""
0 commit comments