Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses curses: believe in unicorns
details: https://anonhg.NetBSD.org/src/rev/7eb60811a4fc
branches: trunk
changeset: 965160:7eb60811a4fc
user: roy <roy%NetBSD.org@localhost>
date: Tue Sep 03 13:43:34 2019 +0000
description:
curses: believe in unicorns
Hopefully this ends the bikeshed.
If you don't believe in unicorns, please #if 0 it out to preserve
the humour.
diffstat:
lib/libcurses/Makefile | 5 +--
lib/libcurses/curses.h | 19 +------------
lib/libcurses/cursesrelease.sh | 59 ------------------------------------------
lib/libcurses/version.c | 28 +++++++++++++++++--
4 files changed, 27 insertions(+), 84 deletions(-)
diffs (162 lines):
diff -r 4f3e1bc3acdc -r 7eb60811a4fc lib/libcurses/Makefile
--- a/lib/libcurses/Makefile Tue Sep 03 10:36:17 2019 +0000
+++ b/lib/libcurses/Makefile Tue Sep 03 13:43:34 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.92 2019/09/03 10:36:17 roy Exp $
+# $NetBSD: Makefile,v 1.93 2019/09/03 13:43:34 roy Exp $
# @(#)Makefile 8.2 (Berkeley) 1/2/94
.include <bsd.own.mk>
@@ -210,8 +210,5 @@
fileio.h: shlib_version genfileioh.awk
${TOOL_AWK} -f ${.CURDIR}/genfileioh.awk < ${.CURDIR}/shlib_version > ${.CURDIR}/fileio.h
-CURSES_VERSION!= ${HOST_SH} ${.CURDIR}/cursesrelease.sh
-CPPFLAGS.version.c+= -DCURSES_VERSION=\"${CURSES_VERSION}\"
-
.include <bsd.lib.mk>
.include <bsd.subdir.mk>
diff -r 4f3e1bc3acdc -r 7eb60811a4fc lib/libcurses/curses.h
--- a/lib/libcurses/curses.h Tue Sep 03 10:36:17 2019 +0000
+++ b/lib/libcurses/curses.h Tue Sep 03 13:43:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: curses.h,v 1.125 2019/09/03 10:36:17 roy Exp $ */
+/* $NetBSD: curses.h,v 1.126 2019/09/03 13:43:34 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -48,23 +48,6 @@
#include <stdbool.h>
/*
- * #define __NetBSD_Curses_Version__ MMmmrrpp00
- *
- * M = major version
- * m = minor version; a minor number of 99 indicates current
- * r = 0 (*)
- * p = patchlevel
- *
- * This is similar to __NetBSD_Version__ as found in sys/param.h
- * It is maintained seperately and has no correlation to it or the
- * ELF symver libcurses is built as.
- */
-#define __NetBSD_Curses_Version__ 0200000000 /* NetBSD-Curses 2.0.0 */
-
-#define __NetBSD_Curses_Prereq__(M,m,p) (((((M) * 100000000) + \
- (m) * 1000000) + (p) * 100) <= __NetBSD_Curses_Version__)
-
-/*
* attr_t must be the same size as wchar_t (see <wchar.h>) to avoid padding
* in __LDATA.
*/
diff -r 4f3e1bc3acdc -r 7eb60811a4fc lib/libcurses/cursesrelease.sh
--- a/lib/libcurses/cursesrelease.sh Tue Sep 03 10:36:17 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-# $NetBSD: cursesrelease.sh,v 1.1 2019/09/03 10:36:17 roy Exp $
-#
-# Copyright (c) 1997 The NetBSD Foundation, Inc.
-# All rights reserved.
-#
-# This code is derived from software contributed to The NetBSD Foundation
-# by Luke Mewburn.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-# We use the number specified in <curses.h>
-
-path="$0"
-[ "${path#/*}" = "$path" ] && path="./$path"
-exec < ${path%/*}/curses.h
-
-# Search for line
-# #define __NetBSD_Curses_Version__ <ver_num> /* NetBSD-Curses <ver_text> */
-#
-# <ver_num> and <ver_text> should match!
-
-while
- read define ver_tag rel_num comment_start NetBSD rel_text rest || exit 1
-do
- [ "$define" = "#define" ] || continue;
- [ "$ver_tag" = "__NetBSD_Curses_Version__" ] || continue
- break
-done
-
-# ${rel_num} is [M]Mmm00pp00
-rel_num=${rel_num%??}
-rel_MMmm=${rel_num%????}
-rel_MM=${rel_MMmm%??}
-rel_mm=${rel_MMmm#${rel_MM}}
-rel_pp=${rel_num#${rel_MMmm}00}
-
-echo "${rel_MM#0}.${rel_mm#0}.${rel_pp#0}"
diff -r 4f3e1bc3acdc -r 7eb60811a4fc lib/libcurses/version.c
--- a/lib/libcurses/version.c Tue Sep 03 10:36:17 2019 +0000
+++ b/lib/libcurses/version.c Tue Sep 03 13:43:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: version.c,v 1.2 2019/09/03 10:36:17 roy Exp $ */
+/* $NetBSD: version.c,v 1.3 2019/09/03 13:43:34 roy Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -31,14 +31,36 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: version.c,v 1.2 2019/09/03 10:36:17 roy Exp $");
+__RCSID("$NetBSD: version.c,v 1.3 2019/09/03 13:43:34 roy Exp $");
#endif
#include "curses.h"
+#ifndef CURSES_VERSION
+/*
+ * Bikeshed about what the version should be, if any:
+ * https://mail-index.netbsd.org/tech-userlevel/2019/09/02/msg012101.html
+ * This is the end result and should at least provide some amusement :)
+ */
+#define CURSES_VERSION "believe in unicorns"
+#endif
+
+#ifdef CURSES_VERSION
+/*
+ * Any version given should be braced to give some indication it's not
+ * really a version recognised by NetBSD.
+ * It should also have some product branding to indicate from whence
+ * if came. For example, if FrobozzCo packaged it:
+ * CFLAGS+= -DCURSES_VERSION="\"FrobozzCo 1.2.3\""
+ */
+#define _CURSES_VERSION " (" CURSES_VERSION ")"
+#else
+#define _CURSES_VERSION
+#endif
+
const char *
curses_version()
{
- return "NetBSD-Curses " CURSES_VERSION;
+ return "NetBSD-Curses" _CURSES_VERSION;
}
Home |
Main Index |
Thread Index |
Old Index