File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ def run(self):
93
93
this_dir = os .path .dirname (os .path .abspath (__file__ ))
94
94
dpctl_build_dir = os .path .join (this_dir , self .build_lib , "dpctl" )
95
95
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 :
100
105
base_fn = os .path .basename (fn )
101
106
src_file = os .path .join (dpctl_build_dir , base_fn )
102
107
dst_file = os .path .join (dpctl_install_dir , base_fn )
108
+ os .remove (dst_file )
103
109
_patched_copy_file (src_file , dst_file )
104
110
return ret
105
111
You can’t perform that action at this time.
0 commit comments