@@ -146,6 +146,9 @@ def main():
146146 create_dir (os .path .join (installer_path_exec , "scripts" ))
147147 create_dir (os .path .join (installer_path_exec , "aslib" ))
148148
149+ shutil .copyfile (version_file_src , os .path .join (
150+ installer_path_exec , "VERSION" ))
151+
149152 shutil .copytree (os .path .join (installer_path , "share" ),
150153 os .path .join (installer_path_exec , "share" ), dirs_exist_ok = True )
151154
@@ -175,17 +178,23 @@ def main():
175178 # in the end, start patching
176179 ld_execs = [filename for filename in os .listdir (os .path .join (
177180 installer_path_exec , "lib" )) if filename .startswith ("ld-linux" )]
178- if (len (ld_execs ) != 1 ):
181+
182+ ld_count = len (ld_execs )
183+ if (ld_count > 1 ):
179184 print (
180185 Fore .RED + "[Error] dynamic linker/loader can not be determined!" + Style .RESET_ALL )
181186 exit (- 3 )
182187
183- ret = run_command_interactive (
184- ["patchelf" , "--set-interpreter" , f"./lib/{ ld_execs [0 ]} " , exemain_src ])
185- if (ret != 0 ):
186- print (
187- Fore .RED + "[Error] patchelf error!" + Style .RESET_ALL )
188- exit (- 4 )
188+ ld_exec = ""
189+
190+ if (ld_count == 1 ):
191+ ld_exec = ld_execs [0 ]
192+ ret = run_command_interactive (
193+ ["patchelf" , "--set-interpreter" , f"./lib/{ ld_exec } " , exemain_src ])
194+ if (ret != 0 ):
195+ print (
196+ Fore .RED + "[Error] patchelf error!" + Style .RESET_ALL )
197+ exit (- 4 )
189198
190199 print (Fore .GREEN + ">> Calculating checksum..." + Style .RESET_ALL )
191200
@@ -201,10 +210,13 @@ def main():
201210
202211 print (Fore .GREEN + ">> Deployment finished..." + Style .RESET_ALL )
203212
204- ld_path = os .path .join (installer_path_exec , "lib" , ld_execs [0 ])
205- if (os .access (ld_path , os .X_OK ) == False ):
206- print (Fore .YELLOW + f"[Warn] {
207- ld_execs [0 ]} has no executable permission! You should set it for running a deployed program!" + Style .RESET_ALL )
213+ if (ld_count == 1 ):
214+ ld_path = os .path .join (installer_path_exec , "lib" , ld_exec )
215+ if (os .access (ld_path , os .X_OK ) == False ):
216+ print (Fore .YELLOW + f"[Warn] { ld_exec } has no executable permission! You should set it for running a deployed program!" + Style .RESET_ALL )
217+
218+ with open (os .path .join (installer_path_exec , "LD_PATH" ), "w" ) as ld_file :
219+ ld_file .write (ld_exec )
208220
209221 exit (0 )
210222
0 commit comments