MSYS2-packages/coreutils/004-msystem-osname-cygwin.patch
Christoph Reiter 80407a247f coreutils: "uname -o" -> Cygwin if MSYSTEM=CYGWIN
If MSYSTEM=CYGWIN we output "Cygwin" as the operating system.
This is relevant in build scripts which call "uname -o" and
check for cygwin there.
2022-07-04 16:30:51 +02:00

19 lines
525 B
Diff

--- coreutils-8.32/src/uname.c.orig 2020-02-04 20:27:08.000000000 +0100
+++ coreutils-8.32/src/uname.c 2022-07-04 16:21:23.554364400 +0200
@@ -367,8 +367,13 @@
print_element (element);
}
- if (toprint & PRINT_OPERATING_SYSTEM)
- print_element (HOST_OPERATING_SYSTEM);
+ if (toprint & PRINT_OPERATING_SYSTEM) {
+ char* msystem = getenv("MSYSTEM");
+ if (msystem && strcmp(msystem, "CYGWIN") == 0)
+ print_element ("Cygwin");
+ else
+ print_element ("Msys");
+ }
putchar ('\n');