@@ -37,9 +37,9 @@ PBPharoPlatform class >> weakRegistryClass [
37
37
{ #category : #private }
38
38
PBPharoPlatform >> copyApplicationTo: appFolder application: application [
39
39
" Copy the PythonBridge runtime environment to the specified folder"
40
- | srcDir cpCommand proc pbSymLink srcFilename dstFilename |
40
+ | srcDir cpCommand proc srcFilename dstFilename |
41
41
42
- srcDir := FileLocator imageDirectory / ' PythonBridge ' .
42
+ srcDir := FileLocator imageDirectory / ' PythonBridgeRuntime ' .
43
43
(srcDir exists and : [ srcDir ~= appFolder ]) ifFalse:
44
44
[ srcDir := self folderForApplication: application ].
45
45
srcDir exists ifFalse:
@@ -60,28 +60,9 @@ PBPharoPlatform >> copyApplicationTo: appFolder application: application [
60
60
runAndWait.
61
61
proc isSuccess ifFalse:
62
62
[ self error: ' Unable to install PythonBridge runtime' ].
63
- " Remove the existing symlink, which probably points to the source folder.
64
- FileReference>>delete doesn't handle symbolic links, so use the lower layer"
65
- pbSymLink := (appFolder / ' PythonBridge' ) resolve.
66
- pbSymLink exists ifTrue:
67
- [ pbSymLink isSymlink
68
- ifTrue: [ self removeFile: pbSymLink ]
69
- ifFalse: [ self error: ' PythonBridge should be a symbolic link' ] ].
70
63
71
64
]
72
65
73
- { #category : #' private - symlinks' }
74
- PBPharoPlatform >> createSymlinkFor: originalFile on: targetFile [
75
- OSSUnixSubprocess new
76
- command: ' /bin/ln' ;
77
- arguments: (Array
78
- with: ' -s'
79
- with: originalFile asFileReference fullName
80
- with: targetFile asFileReference fullName);
81
- terminateOnShutdown;
82
- runAndWaitOnExitDo: [ :command | ^ self ].
83
- ]
84
-
85
66
{ #category : #' message broker strategy' }
86
67
PBPharoPlatform >> defaultMessageBrokerClass [
87
68
^ self class socketMessageBrokerClass
@@ -94,7 +75,7 @@ PBPharoPlatform >> ensureApplicationDirectory: application [
94
75
appFolder := application workingDirectory.
95
76
(appFolder / ' PythonBridge' ) exists ifTrue: [ ^ self ].
96
77
self copyApplicationTo: appFolder application: application.
97
- self ensurePBridge: ( self folderForApplication: application class baseApplication) symlinkIn: appFolder.
78
+
98
79
]
99
80
100
81
{ #category : #private }
@@ -104,30 +85,14 @@ PBPharoPlatform >> ensureEnvironmentForApp: anApplication [
104
85
self installEnvironmentForApp: anApplication.
105
86
]
106
87
107
- { #category : #' private - symlinks' }
108
- PBPharoPlatform >> ensureFolderSymlinkFor: aFolder [
109
- | symlinkRef |
110
- symlinkRef := aFolder basename asFileReference.
111
- symlinkRef exists ifFalse: [
112
- self createSymlinkFor: aFolder on: symlinkRef ]
113
- ]
114
-
115
- { #category : #' private - symlinks' }
116
- PBPharoPlatform >> ensurePBridge: pbridgeFolder symlinkIn: aFolder [
117
- | symlinkRef |
118
- symlinkRef := aFolder / ' PythonBridge' .
119
- symlinkRef exists ifFalse: [
120
- self createSymlinkFor: aFolder on: symlinkRef ].
121
- ]
122
-
123
88
{ #category : #utils }
124
89
PBPharoPlatform >> folderForApplication: application [
125
90
^ (IceRepository registry
126
91
detect: [ :each | each includesPackageNamed: application class package name ]
127
92
ifNone: [
128
93
self inform: ' Please add a clone of this project to Iceberg to access to the resources' .
129
94
" For travis!"
130
- ^ ' .' asFileReference ]) location
95
+ ^ ' .' asFileReference ]) location / ' PythonBridgeRuntime '
131
96
]
132
97
133
98
{ #category : #utils }
@@ -173,20 +138,6 @@ PBPharoPlatform >> pipenvForApplication: application [
173
138
[ self class pipenvProcessClass pipenvPath ]
174
139
]
175
140
176
- { #category : #' private - symlinks' }
177
- PBPharoPlatform >> removeFile: aFileReference [
178
- " Use the OS rm command to remove the specified file.
179
- Required since the file system primitive doesn't seem to handle symbolic links"
180
- | proc |
181
-
182
- proc := OSSUnixSubprocess new
183
- command: ' rm' ;
184
- arguments: { aFileReference fullName };
185
- runAndWait.
186
- proc isSuccess ifFalse:
187
- [ self error: ' Unable to remove: ' , aFileReference fullName ]
188
- ]
189
-
190
141
{ #category : #accessing }
191
142
PBPharoPlatform >> runtimeFolder [
192
143
" Answer the directory where the PythonBridge runtime files are located"
0 commit comments