This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree 4 files changed +33
-80
lines changed
4 files changed +33
-80
lines changed Original file line number Diff line number Diff line change @@ -182,57 +182,10 @@ bool is_executable(const pal::string_t& file_path)
182
182
return ((st.st_mode & S_IEXEC) != 0 );
183
183
}
184
184
185
- static
186
- bool locate_dotnet_on_path (std::vector<pal::string_t >* dotnet_exes)
187
- {
188
- pal::string_t path;
189
- if (!pal::getenv (_X (" PATH" ), &path))
190
- {
191
- return false ;
192
- }
193
-
194
- pal::string_t tok;
195
- pal::stringstream_t ss (path);
196
- while (std::getline (ss, tok, PATH_SEPARATOR))
197
- {
198
- size_t start_pos = tok.find_first_not_of (_X (" \t " ));
199
- if (start_pos == pal::string_t ::npos)
200
- {
201
- continue ;
202
- }
203
-
204
- append_path (&tok, _X (" dotnet" ));
205
- if (pal::realpath (&tok) && is_executable (tok))
206
- {
207
- dotnet_exes->push_back (tok);
208
- }
209
- tok.clear ();
210
- }
211
-
212
- if (dotnet_exes->empty ())
213
- {
214
- return false ;
215
- }
216
-
217
- return true ;
218
- }
219
-
220
185
bool pal::get_global_dotnet_dirs (std::vector<pal::string_t >* recv)
221
186
{
222
-
223
- std::vector<pal::string_t > dotnet_exes;
224
- if (!locate_dotnet_on_path (&dotnet_exes))
225
- {
226
- return false ;
227
- }
228
-
229
- for (pal::string_t path : dotnet_exes)
230
- {
231
- pal::string_t dir = get_directory (path);
232
- recv->push_back (dir);
233
- }
234
-
235
- return true ;
187
+ // No support for global directories in Unix.
188
+ return false ;
236
189
}
237
190
238
191
pal::string_t trim_quotes (pal::string_t stringToCleanup)
Original file line number Diff line number Diff line change @@ -169,6 +169,11 @@ public void SharedFxLookup_Must_Roll_Forward_Before_Looking_Into_Another_Folder(
169
169
{
170
170
return ;
171
171
}
172
+ else
173
+ {
174
+ // Currently no support for global locations on Linux; remaining test code below is preserved for now.
175
+ return ;
176
+ }
172
177
173
178
var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
174
179
. Copy ( ) ;
@@ -415,6 +420,11 @@ public void Roll_Forward_On_No_Candidate_Fx_Must_Look_Into_All_Lookup_Folders()
415
420
{
416
421
return ;
417
422
}
423
+ else
424
+ {
425
+ // Currently no support for global locations on Linux; remaining test code below is preserved for now.
426
+ return ;
427
+ }
418
428
419
429
var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
420
430
. Copy ( ) ;
@@ -481,6 +491,11 @@ public void Roll_Forward_On_No_Candidate_Fx_May_Be_Enabled_Through_Runtimeconfig
481
491
{
482
492
return ;
483
493
}
494
+ else
495
+ {
496
+ // Currently no support for global locations on Linux; remaining test code below is preserved for now.
497
+ return ;
498
+ }
484
499
485
500
var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
486
501
. Copy ( ) ;
@@ -529,7 +544,12 @@ public void Roll_Forward_On_No_Candidate_Fx_May_Be_Enabled_Through_Argument()
529
544
{
530
545
return ;
531
546
}
532
-
547
+ else
548
+ {
549
+ // Currently no support for global locations on Linux; remaining test code below is preserved for now.
550
+ return ;
551
+ }
552
+
533
553
var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
534
554
. Copy ( ) ;
535
555
@@ -595,7 +615,12 @@ public void Ensure_On_NonWindows_Multiple_Global_Locations_Are_Probed()
595
615
{
596
616
return ;
597
617
}
598
-
618
+ else
619
+ {
620
+ // Currently no support for global locations on Linux; remaining test code below is preserved for now.
621
+ return ;
622
+ }
623
+
599
624
var fixture = PreviouslyBuiltAndRestoredPortableTestProjectFixture
600
625
. Copy ( ) ;
601
626
Original file line number Diff line number Diff line change @@ -238,41 +238,17 @@ public Command WithUserProfile(string userprofile)
238
238
_process . StartInfo . Environment [ userDir ] = userprofile ;
239
239
return this ;
240
240
}
241
- public Command SanitizeGlobalLocation ( )
242
- {
243
- if ( RuntimeEnvironment . OperatingSystemPlatform != Platform . Windows )
244
- {
245
- var current_path = _process . StartInfo . Environment [ "PATH" ] ;
246
- var new_path = new System . Text . StringBuilder ( ) ;
247
- //Remove any global dotnet that has been set
248
- foreach ( var sub_path in current_path . Split ( Path . PathSeparator ) )
249
- {
250
- var candidate = Path . Combine ( sub_path , "dotnet" ) ;
251
- if ( ! File . Exists ( candidate ) )
252
- {
253
- new_path . Append ( sub_path ) ;
254
- new_path . Append ( Path . PathSeparator ) ;
255
- }
256
- }
257
- _process . StartInfo . Environment [ "PATH" ] = new_path . ToString ( ) ;
258
- }
259
- return this ;
260
- }
241
+
261
242
public Command WithGlobalLocation ( string global )
262
243
{
263
-
264
244
if ( RuntimeEnvironment . OperatingSystemPlatform == Platform . Windows )
265
245
{
266
- throw new NotImplementedException ( "Global location override needs work " ) ;
246
+ throw new NotImplementedException ( "Global location override needs test improvements for Windows " ) ;
267
247
}
268
248
else
269
249
{
270
- var current_path = _process . StartInfo . Environment [ "PATH" ] ;
271
- _process . StartInfo . Environment [ "PATH" ] = current_path + Path . PathSeparator + global ;
250
+ throw new NotSupportedException ( "Global location override not supported for Linux" ) ;
272
251
}
273
-
274
-
275
- return this ;
276
252
}
277
253
278
254
public Command EnvironmentVariable ( string name , string value )
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ public Command Exec(string command, params string[] args)
31
31
}
32
32
33
33
return Command . Create ( Path . Combine ( BinPath , $ "dotnet{ Constants . ExeSuffix } ") , newArgs )
34
- . EnvironmentVariable ( "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , "1" )
35
- . SanitizeGlobalLocation ( ) ;
34
+ . EnvironmentVariable ( "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" , "1" ) ;
36
35
}
37
36
38
37
public Command Restore ( params string [ ] args ) => Exec ( "restore" , args ) ;
You can’t perform that action at this time.
0 commit comments