pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/56048
The following reply was made to PR pkg/56048; it has been noted by GNATS.
From: Yasushi Oshima <oshima-ya%yagoto-urayama.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: pkg/56048
Date: Sat, 22 May 2021 01:46:35 +0900 (JST)
Dear,
> Set "OS Environment" on NetBSD,same as FreeBSD.
I don't think this change is suitable because the rules of release-name
for NetBSD and FreeBSD are different and this #ifdef is made for FreeBSD.
In fact, this change causes in NetBSD 9.2 and 9.2_STABLE to display:
"OS: !!br0ken!!", this is wrong (will be the same for 8.x and future
10.0 or lator). The reason for this is probably that this FreeBSD code
is in an unexpected state with the case of NetBSD's release-name
The code for FreeBSD seems to be trying to remove strings like
"-RELEASE", "-CURRENT" and others, or, patch release numbers like "5.2.1".
I suggest that it simply display utsname.release directly.
For example:
--- vcl/unx/generic/app/geninst.cxx.orig 2021-04-29 01:17:45.000000000 +0900
+++ vcl/unx/generic/app/geninst.cxx 2021-05-22 00:50:12.160401669 +0900
@@ -22,7 +22,7 @@
#if defined(LINUX)
# include <stdio.h>
#endif
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
# include <sys/utsname.h>
#endif
@@ -73,14 +73,18 @@
fclose( pVersion );
}
return aKernelVer;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
struct utsname stName;
if ( uname( &stName ) != 0 )
return aKernelVer;
+ aKernelVer = OUString::createFromAscii( stName.release );
+#if defined(__NetBSD__)
+ return OUString::createFromAscii( stName.sysname ) + " " +
+ aKernelVer.copy( 0, aKernelVer.getLength() );
+#else /* __FreeBSD__ */
sal_Int32 nDots = 0;
sal_Int32 nIndex = 0;
- aKernelVer = OUString::createFromAscii( stName.release );
while ( nIndex++ < aKernelVer.getLength() )
{
const char c = stName.release[ nIndex ];
@@ -89,6 +93,7 @@
}
return OUString::createFromAscii( stName.sysname ) + " " +
aKernelVer.copy( 0, nIndex );
+#endif
#else
return aKernelVer;
#endif
Thanks.
--
Yasushi Oshima
Home |
Main Index |
Thread Index |
Old Index