From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 495AA382EF21; Thu, 24 Nov 2022 19:51:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 495AA382EF21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669319477; bh=fl0eVKNtwjpLn5EYqmJaM3Grtbl574Jn+iSH7HY4REM=; h=From:To:Subject:Date:From; b=vxmw2Mr1IhP4MCn0d1wSTP8xybOTC9ZjOYo1HNzWDpVIvNkjbpZ568N0yg9SGByvO +TgQaiccW9qem7JcOkbqoxzPVavGX1xUfZEczilKxmZ522MXQPbDJrvbKQfB9j1Dbz 9oGNXTAgg9LvAXiXYEmGLc2uVAxEwPVSCoK43lx0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: uname: allow to specify external release info X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 244be41a1f8dee5c9c8ee48742172fcce0010571 X-Git-Newrev: afa957ae5b8187996e0c7c500e2b747cd55347e9 Message-Id: <20221124195117.495AA382EF21@sourceware.org> Date: Thu, 24 Nov 2022 19:51:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dafa957ae5b8= 187996e0c7c500e2b747cd55347e9 commit afa957ae5b8187996e0c7c500e2b747cd55347e9 Author: Corinna Vinschen Date: Thu Nov 24 12:23:09 2022 +0100 Cygwin: uname: allow to specify external release info =20 When creating regular Cygwin test releases we need a way to automate unambiguous version information based on the output of `git describe'. Allow to inject a release string via a preprocessor macro CYGPORT__RELEASE_INFO. Change the default release info to recognize a local, non-distro build. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/uname.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc index 7e0d8849b..e893660c6 100644 --- a/winsup/cygwin/uname.cc +++ b/winsup/cygwin/uname.cc @@ -42,11 +42,15 @@ uname_x (struct utsname *name) cygwin_gethostname (buf, sizeof buf - 1); strncat (name->nodename, buf, sizeof (name->nodename) - 1); /* release */ - __small_sprintf (name->release, "%d.%d.%d-%d.", +#ifdef CYGPORT_RELEASE_INFO + stpcpy (name->release, __XSTRING (CYGPORT_RELEASE_INFO)); +#else + __small_sprintf (name->release, "%d.%d.%d-0.%d.local.", cygwin_version.dll_major / 1000, cygwin_version.dll_major % 1000, cygwin_version.dll_minor, cygwin_version.api_minor); +#endif /* version */ stpcpy (name->version, cygwin_version.dll_build_date); strcat (name->version, " UTC");