1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

resolve/remove USAGE_LICENSE macros; remove repetitive (c) strings

This takes another small step towards disentangling the build
system from the old AT&T environment. The USAGE_LICENSE macros with
author and copyright information, which was formerly generated
dynamically for each file from a database, are eliminated and the
copyright/author information is instead inserted into the AST
getopt usage strings directly.

Repetitive license/copyright information is also removed from the
getopt strings in the builtin commands (src/lib/libcmd/*.c and
src/cmd/ksh93/data/builtins.c). There's no need to include 55
identical license/copyright strings in the ksh binary; one (in the
main ksh getopt string, shown by ksh --man) ought to be enough!
This makes the ksh binary about 10k smaller.

It does mean that something like 'enum --author', 'typeset
--license' or 'shift --copyright' will now not show those notices
for those builtins, but I doubt anyone will care.
This commit is contained in:
Martijn Dekker 2021-01-31 10:41:11 +00:00
parent 66e1d44642
commit ede479967f
65 changed files with 236 additions and 223 deletions

View file

@ -71,16 +71,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - hurl.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat hurl.sh
exec - } > hurl
exec - ;;
exec - esac
exec - ;;
exec - *) cat - hurl.sh > hurl <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -112,16 +109,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - iffe.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Phong Vo <kpv@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat iffe.sh
exec - } > iffe
exec - ;;
exec - esac
exec - ;;
exec - *) cat - iffe.sh > iffe <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Phong Vo <kpv@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -153,16 +147,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - mktest.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat mktest.sh
exec - } > mktest
exec - ;;
exec - esac
exec - ;;
exec - *) cat - mktest.sh > mktest <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -193,16 +184,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - package.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat package.sh
exec - } > package
exec - ;;
exec - esac
exec - ;;
exec - *) cat - package.sh > package <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -234,16 +222,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - regress.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat regress.sh
exec - } > regress
exec - ;;
exec - esac
exec - ;;
exec - *) cat - regress.sh > regress <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -275,16 +260,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - rt.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat rt.sh
exec - } > rt
exec - ;;
exec - esac
exec - ;;
exec - *) cat - rt.sh > rt <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -315,16 +297,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - crossexec.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat crossexec.sh
exec - } > crossexec
exec - ;;
exec - esac
exec - ;;
exec - *) cat - crossexec.sh > crossexec <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -356,16 +335,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - ditto.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Lefty Koutsofios <ek@research.att.com>][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat ditto.sh
exec - } > ditto
exec - ;;
exec - esac
exec - ;;
exec - *) cat - ditto.sh > ditto <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Lefty Koutsofios <ek@research.att.com>][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -397,16 +373,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - execrate.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat execrate.sh
exec - } > execrate
exec - ;;
exec - esac
exec - ;;
exec - *) cat - execrate.sh > execrate <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -437,16 +410,13 @@ make install
exec - case $i in
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
exec - esac
exec - cat - filter.sh <<'!'
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - cat filter.sh
exec - } > filter
exec - ;;
exec - esac
exec - ;;
exec - *) cat - filter.sh > filter <<'!'
exec - ${mam_cc_SHELLMAGIC}
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
exec - !
exec - ;;
exec - esac
@ -542,7 +512,7 @@ make install
done mamake.c
meta mamake.o %.c>%.o mamake.c mamake
prev mamake.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c mamake.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c mamake.c
done mamake.o generated
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o
done mamake generated
@ -588,7 +558,7 @@ make install
done release.c
meta release.o %.c>%.o release.c release
prev release.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c release.c
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c release.c
done release.o generated
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o release release.o
done release generated

View file

@ -31,7 +31,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: crossexec (AT&T Labs Research) 2004-01-04 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?crossexec - cross compiler a.out execution]
[+DESCRIPTION?\bcrossexec\b runs a cross-compiled \acommand\a in an environment
that supports a cross-compilation architecture different from the

View file

@ -26,7 +26,10 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: ditto (AT&T Labs Research) 2010-11-22 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Lefty Koutsofios <ek@research.att.com>]
[-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?ditto - replicate directory hierarchies]
[+DESCRIPTION?\bditto\b replicates the \asource\a directory hierarchy
to the \adestination\a directory hierarchy. Both \asource\a and

View file

@ -37,7 +37,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: execrate (AT&T Labs Research) 2002-02-02 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?execrate - wrapper for .exe challenged commands]
[+DESCRIPTION?\bexecrate\b runs \acommand\a after checking the \afile\a
operands for standard semantics with respect to \bwin32\b \b.exe\b

View file

@ -34,7 +34,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: filter (AT&T Labs Research) 2001-05-31 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?filter - run a command in stdin/stdout mode]
[+DESCRIPTION?\bfilter\b runs \acommand\a in a mode that takes input from
the \afile\a operands, or from the standard input if no \afile\a

View file

@ -32,7 +32,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: hurl (AT&T Research) 2009-01-20 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?hurl - copy http url data]
[+DESCRIPTION?\bhurl\b copies the data for the \bhttp\b \aurl\a operand
to the standard output. The \aurl\a must be of the form

View file

@ -721,7 +721,10 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: iffe (AT&T Research) 2012-07-17 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Phong Vo <kpv@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?iffe - C compilation environment feature probe]
[+DESCRIPTION?\biffe\b is a command interpreter that probes the C
compilation environment for features. A feature is any file, option

View file

@ -27,7 +27,7 @@
*/
#define RELEASE_DATE "2021-01-21"
static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0\n";
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
#if _PACKAGE_ast
@ -35,8 +35,11 @@ static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0
#include <error.h>
static const char usage[] =
"[-?\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\n]"
USAGE_LICENSE
"[-?\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\n]"
"[-author?Glenn Fowler <gsf@research.att.com>]"
"[-copyright?(c) 1994-2012 AT&T Intellectual Property]"
"[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]"
"[-license?http://www.eclipse.org/org/documents/epl-v10.html]"
"[+NAME?mamake - make abstract machine make]"
"[+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and"
" prerequisite file descriptions from a mamfile (see \b-f\b) and executes"

View file

@ -34,7 +34,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
[-?
@(#)$Id: mktest (AT&T Labs Research) 2010-08-11 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?mktest - generate a regression test scripts]
[+DESCRIPTION?\bmktest\b generates regression test scripts from test
template commands in the \aunit\a.\brt\b file. The generated test

View file

@ -121,7 +121,10 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
@(#)$Id: package (AT&T Research) 2012-06-28 $
]'$USAGE_LICENSE$'
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
packages. It is a \bsh\b(1) script coded for maximal portability. All

View file

@ -25,7 +25,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
[-?
@(#)$Id: regress (AT&T Research) 2012-02-02 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?regress - run regression tests]
[+DESCRIPTION?\bregress\b runs the tests in \aunit\a, or
\aunit\a\b.tst\b if \aunit\a does not exist. If \acommand\a is omitted

View file

@ -35,7 +35,9 @@ static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n";
static const char usage[] =
"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]"
USAGE_LICENSE
"[-author?Glenn Fowler <gsf@research.att.com>]"
"[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]"
"[-license?http://www.eclipse.org/org/documents/epl-v10.html]"
"[+NAME?release - list recent changes]"
"[+DESCRIPTION?\brelease\b lists the changes within the date range specified"
" by the \b--from\b and \b--to\b options. The input files are assumed to"

View file

@ -31,7 +31,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
[-?
@(#)$Id: rt (AT&T Research) 2010-07-27 $
]
'$USAGE_LICENSE$'
[-author?Glenn Fowler <gsf@research.att.com>]
[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property]
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
[+NAME?rt - run "nmake test" and filter output]
[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression
test output to contain only test summary lines. If no \atest\a