mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
[mkbundle] fix execution for X.Android on Windows regarding dos2unix.
This fixes bug #25086 (Xamarin.Android). Details described there. To fix the issue, we use #if XAMARIN_ANDROID to avoid that old cygwin-only code path. (We are not sure if simply removing the old code still works, so we don't remove that for now.)
This commit is contained in:
1 parent
73699dc332
commit
bcfec743d5
1 file changed
+6
@@ -704,6 +704,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
|
||||
return system (cmdLine);
|
||||
}
|
||||
|
||||
#if XAMARIN_ANDROID
|
||||
// on Windows, we have to pipe the output of a
|
||||
// `cmd` interpolation to dos2unix, because the shell does not
|
||||
// strip the CRLFs generated by the native pkg-config distributed
|
||||
@@ -732,6 +733,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
|
||||
}
|
||||
// and if there is no dos2unix, just run cmd /c.
|
||||
if (use_dos2unix == false) {
|
||||
#endif
|
||||
Console.WriteLine (cmdLine);
|
||||
ProcessStartInfo dos2unix = new ProcessStartInfo ();
|
||||
dos2unix.UseShellExecute = false;
|
||||
@@ -742,15 +744,19 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
|
||||
p.WaitForExit ();
|
||||
return p.ExitCode;
|
||||
}
|
||||
#if XAMARIN_ANDROID
|
||||
}
|
||||
#endif
|
||||
|
||||
StringBuilder b = new StringBuilder ();
|
||||
int count = 0;
|
||||
for (int i = 0; i < cmdLine.Length; i++) {
|
||||
if (cmdLine [i] == '`') {
|
||||
#if XAMARIN_ANDROID
|
||||
if (count % 2 != 0) {
|
||||
b.Append ("|dos2unix");
|
||||
}
|
||||
#endif
|
||||
count++;
|
||||
}
|
||||
b.Append (cmdLine [i]);
|
||||
|
||||
Reference in new issue
Block a user