File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ def run(self):
9393 this_dir = os .path .dirname (os .path .abspath (__file__ ))
9494 dpctl_build_dir = os .path .join (this_dir , self .build_lib , "dpctl" )
9595 dpctl_install_dir = os .path .join (self .install_libbase , "dpctl" )
96- for fn in glob .glob (
97- os .path .join (dpctl_install_dir , "*DPCTLSyclInterface.so*" )
98- ):
99- os .remove (fn )
96+ sofiles = glob .glob (
97+ os .path .join (dpctl_build_dir , "*DPCTLSyclInterface.so*" )
98+ )
99+ # insert actual file at the beginning of the list
100+ pos = [i for i , fn in enumerate (sofiles ) if not os .path .islink (fn )]
101+ if pos :
102+ hard_file = sofiles .pop (pos [0 ])
103+ sofiles .insert (0 , hard_file )
104+ for fn in sofiles :
100105 base_fn = os .path .basename (fn )
101106 src_file = os .path .join (dpctl_build_dir , base_fn )
102107 dst_file = os .path .join (dpctl_install_dir , base_fn )
108+ os .remove (dst_file )
103109 _patched_copy_file (src_file , dst_file )
104110 return ret
105111
You can’t perform that action at this time.
0 commit comments