Skip to content

Commit

Permalink
Step 1 of eliminating the "games" distribution: Move binaries to /usr…
Browse files Browse the repository at this point in the history
…/bin;

update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive.  Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities.  I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by:	jmg
Discussed at:	EuroBSDCon
Approved by:	gjb (release-affecting changes)
  • Loading branch information
cperciva committed Feb 12, 2015
1 parent b5d6898 commit 11d9aa6
Show file tree
Hide file tree
Showing 31 changed files with 66 additions and 62 deletions.
8 changes: 2 additions & 6 deletions Makefile.inc1
Expand Up @@ -189,9 +189,8 @@ OBJTREE= ${MAKEOBJDIRPREFIX}
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
.endif
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
# /usr/games added for fortune which depend on strfile
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
STRICTTMPPATH= ${BPATH}:${XPATH}
TMPPATH= ${STRICTTMPPATH}:${PATH}

Expand Down Expand Up @@ -807,9 +806,6 @@ ITOOLS+=makewhatis

# Non-base distributions produced by the base system
EXTRA_DISTRIBUTIONS= doc
.if ${MK_GAMES} != "no"
EXTRA_DISTRIBUTIONS+= games
.endif
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
EXTRA_DISTRIBUTIONS+= lib32
.endif
Expand Down
16 changes: 16 additions & 0 deletions ObsoleteFiles.inc
Expand Up @@ -38,6 +38,22 @@
# xargs -n1 | sort | uniq -d;
# done

# 20150212: /usr/games moving into /usr/bin
OLD_FILES+=usr/games/bcd
OLD_FILES+=usr/games/caesar
OLD_FILES+=usr/games/factor
OLD_FILES+=usr/games/fortune
OLD_FILES+=usr/games/grdc
OLD_FILES+=usr/games/morse
OLD_FILES+=usr/games/number
OLD_FILES+=usr/games/pom
OLD_FILES+=usr/games/ppt
OLD_FILES+=usr/games/primes
OLD_FILES+=usr/games/random
OLD_FILES+=usr/games/rot13
OLD_FILES+=usr/games/strfile
OLD_FILES+=usr/games/unstr
OLD_DIRS+=usr/games
# 20150209: liblzma header
OLD_FILES+=usr/include/lzma/lzma.h
# 20150124: spl.9 and friends
Expand Down
6 changes: 3 additions & 3 deletions contrib/netbsd-tests/games/t_factor.sh
Expand Up @@ -27,13 +27,13 @@

expect() {
echo "${2}" >expout
atf_check -s eq:0 -o file:expout -e empty /usr/games/factor ${1}
atf_check -s eq:0 -o file:expout -e empty /usr/bin/factor ${1}
}

atf_test_case overflow
overflow_head() {
atf_set "descr" "Tests for overflow conditions"
atf_set "require.progs" "/usr/games/factor"
atf_set "require.progs" "/usr/bin/factor"
}
overflow_body() {
expect '8675309' '8675309: 8675309'
Expand All @@ -44,7 +44,7 @@ atf_test_case loop
loop_head() {
atf_set "descr" "Tests some cases that once locked the program" \
"in an infinite loop"
atf_set "require.progs" "/usr/games/factor"
atf_set "require.progs" "/usr/bin/factor"
}
loop_body() {
expect '99999999999991' '99999999999991: 7 13 769231 1428571'
Expand Down
2 changes: 1 addition & 1 deletion etc/login.conf
Expand Up @@ -27,7 +27,7 @@ default:\
:copyright=/etc/COPYRIGHT:\
:welcome=/etc/motd:\
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\
:nologin=/var/run/nologin:\
:cputime=unlimited:\
:datasize=unlimited:\
Expand Down
2 changes: 1 addition & 1 deletion etc/master.passwd
Expand Up @@ -7,7 +7,7 @@ operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/usr/games:/usr/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
Expand Down
2 changes: 0 additions & 2 deletions etc/mtree/BSD.debug.dist
Expand Up @@ -21,8 +21,6 @@
usr
bin
..
games
..
lib
clang
3.5.1
Expand Down
2 changes: 0 additions & 2 deletions etc/mtree/BSD.usr.dist
Expand Up @@ -7,8 +7,6 @@
.
bin
..
games
..
include
..
lib
Expand Down
2 changes: 1 addition & 1 deletion etc/root/dot.cshrc
Expand Up @@ -15,7 +15,7 @@ alias ll ls -lAF
# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)

setenv EDITOR vi
setenv PAGER more
Expand Down
2 changes: 1 addition & 1 deletion etc/root/dot.login
Expand Up @@ -6,4 +6,4 @@
#

# Uncomment to display a random cookie each login:
# if ( -x /usr/games/fortune ) /usr/games/fortune -s
# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s
2 changes: 1 addition & 1 deletion etc/root/dot.profile
@@ -1,6 +1,6 @@
# $FreeBSD$
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin
export PATH
HOME=/root
export HOME
Expand Down
3 changes: 1 addition & 2 deletions games/Makefile.inc
@@ -1,7 +1,6 @@
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
# $FreeBSD$

BINDIR?= /usr/games
BINDIR?= /usr/bin
FILESDIR?= ${SHAREDIR}/games
WARNS?= 6
DISTRIBUTION?= games
2 changes: 1 addition & 1 deletion games/caesar/rot13.sh
Expand Up @@ -30,4 +30,4 @@
# @(#)rot13.sh 8.1 (Berkeley) 5/31/93
# $FreeBSD$

exec /usr/games/caesar 13 "$@"
exec /usr/bin/caesar 13 "$@"
2 changes: 1 addition & 1 deletion games/fortune/datfiles/Makefile
Expand Up @@ -15,7 +15,7 @@ FILESDIR= ${SHAREDIR}/games/fortune

.for f in ${DB}
$f.dat: $f
PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
PATH=$$PATH:/usr/bin:${.OBJDIR}/../strfile \
strfile -Cs ${.ALLSRC} ${.TARGET}
.endfor

Expand Down
1 change: 0 additions & 1 deletion release/scripts/make-manifest.sh
Expand Up @@ -13,7 +13,6 @@ desc_base="Base system (MANDATORY)"
desc_kernel="Kernel (MANDATORY)"
desc_doc="Additional documentation"
doc_default=off
desc_games="Games (fortune, etc.)"
desc_lib32="32-bit compatibility libraries"
desc_ports="Ports tree"
desc_src="System source code"
Expand Down
2 changes: 1 addition & 1 deletion share/man/man4/led.4
Expand Up @@ -170,7 +170,7 @@ flashes
.Pp
.Dl *_*__**_
.Bd -literal
/usr/games/morse -l "Soekris rocks" > /dev/led/error
/usr/bin/morse -l "Soekris rocks" > /dev/led/error
.Ed
.Sh SEE ALSO
.Xr morse 6
Expand Down
11 changes: 8 additions & 3 deletions share/man/man6/intro.6
Expand Up @@ -37,21 +37,26 @@
This section contains information about games.
The games
are located in
.Pa /usr/games
.Pa /usr/bin
if installed.
You can get a short overview about all the games with the
command:
.Bd -literal -offset indent
$ apropos '\\(6\\)'
.Ed
.Sh FILES
.Bl -tag -width /usr/games -compact
.It Pa /usr/games
.Bl -tag -width /usr/bin -compact
.It Pa /usr/bin
location of games
.El
.Sh SEE ALSO
.Xr intro 1
.Sh HISTORY
In earlier versions of
.Fx ,
games were located in
.Pa /usr/games .
.Pp
The
.Nm
section manual page appeared in
Expand Down
2 changes: 0 additions & 2 deletions share/man/man7/hier.7
Expand Up @@ -187,8 +187,6 @@ common utilities, programming tools, and applications
.It Pa compat/
files needed to support binary compatibility with other operating systems,
such as Linux
.It Pa games/
useful and semi-frivolous programs
.It Pa include/
standard C include files
.Pp
Expand Down
2 changes: 1 addition & 1 deletion share/mk/bsd.prog.mk
Expand Up @@ -62,7 +62,7 @@ PROG_FULL=${PROG}.full
${BINDIR} == "/bin" ||\
${BINDIR} == "/libexec" ||\
${BINDIR} == "/sbin" ||\
${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\
${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\
)
DEBUGFILEDIR= ${DEBUGDIR}${BINDIR}
.else
Expand Down
2 changes: 1 addition & 1 deletion share/skel/dot.cshrc
Expand Up @@ -14,7 +14,7 @@ alias ll ls -lAF

# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
# set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
# setenv BLOCKSIZE K
# A righteous umask
# umask 22
Expand Down
2 changes: 1 addition & 1 deletion share/skel/dot.login
Expand Up @@ -5,4 +5,4 @@
# see also csh(1), environ(7).
#

if ( -x /usr/games/fortune ) /usr/games/fortune freebsd-tips
if ( -x /usr/bin/fortune ) /usr/bin/fortune freebsd-tips
4 changes: 2 additions & 2 deletions share/skel/dot.profile
Expand Up @@ -7,7 +7,7 @@

# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
# BLOCKSIZE=K; export BLOCKSIZE

# Setting TERM is normally done through /etc/ttys. Do only override
Expand All @@ -21,4 +21,4 @@ PAGER=more; export PAGER
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV

if [ -x /usr/games/fortune ] ; then /usr/games/fortune freebsd-tips ; fi
if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune freebsd-tips ; fi
29 changes: 14 additions & 15 deletions tools/build/mk/OptionalObsoleteFiles.inc
Expand Up @@ -1606,21 +1606,20 @@ OLD_FILES+=usr/share/man/man8/freebsd-update.8.gz
.endif

.if ${MK_GAMES} == no
OLD_FILES+=usr/games/bcd
OLD_FILES+=usr/games/caesar
OLD_FILES+=usr/games/factor
OLD_FILES+=usr/games/fortune
OLD_FILES+=usr/games/grdc
OLD_FILES+=usr/games/morse
OLD_FILES+=usr/games/number
OLD_FILES+=usr/games/pom
OLD_FILES+=usr/games/ppt
OLD_FILES+=usr/games/primes
OLD_FILES+=usr/games/random
OLD_FILES+=usr/games/rot13
OLD_FILES+=usr/games/strfile
OLD_FILES+=usr/games/unstr
OLD_DIRS+=usr/games
OLD_FILES+=usr/bin/bcd
OLD_FILES+=usr/bin/caesar
OLD_FILES+=usr/bin/factor
OLD_FILES+=usr/bin/fortune
OLD_FILES+=usr/bin/grdc
OLD_FILES+=usr/bin/morse
OLD_FILES+=usr/bin/number
OLD_FILES+=usr/bin/pom
OLD_FILES+=usr/bin/ppt
OLD_FILES+=usr/bin/primes
OLD_FILES+=usr/bin/random
OLD_FILES+=usr/bin/rot13
OLD_FILES+=usr/bin/strfile
OLD_FILES+=usr/bin/unstr
OLD_FILES+=usr/share/games/fortune/fortunes
OLD_FILES+=usr/share/games/fortune/fortunes.dat
OLD_FILES+=usr/share/games/fortune/freebsd-tips
Expand Down
2 changes: 1 addition & 1 deletion tools/tools/nanobsd/gateworks/Files/root/.profile
@@ -1,6 +1,6 @@
# $FreeBSD: src/etc/root/dot.profile,v 1.21 2007/05/29 06:33:10 dougb Exp $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin
export PATH
HOME=/root; export HOME
TERM=${TERM:-xterm}; export TERM
Expand Down
2 changes: 1 addition & 1 deletion tools/tools/nanobsd/pcengines/Files/root/.cshrc
Expand Up @@ -14,7 +14,7 @@ alias ll ls -lA
# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)

setenv EDITOR vi
setenv PAGER more
Expand Down
2 changes: 1 addition & 1 deletion tools/tools/nanobsd/pcengines/Files/root/.login
Expand Up @@ -6,4 +6,4 @@
#

# Uncomment to display a random cookie each login:
# [ -x /usr/games/fortune ] && /usr/games/fortune -s
# [ -x /usr/bin/fortune ] && /usr/bin/fortune -s
2 changes: 1 addition & 1 deletion tools/tools/nanobsd/rescue/Files/root/.cshrc
Expand Up @@ -11,7 +11,7 @@
a lm 'll | more'
a m more

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin)
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin)
setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man"

setenv PAGER more
Expand Down
3 changes: 1 addition & 2 deletions usr.bin/whereis/pathnames.h
Expand Up @@ -25,9 +25,8 @@
* $FreeBSD$
*/

/* Where to look for libexec and games */
/* Where to look for libexec */
#define PATH_LIBEXEC "/usr/libexec"
#define PATH_GAMES "/usr/games"

/* Where to look for sources. */
#define PATH_SOURCES \
Expand Down
3 changes: 1 addition & 2 deletions usr.bin/whereis/whereis.1
Expand Up @@ -65,8 +65,7 @@ The default path searched is the string returned by the
utility for the
.Dq user.cs_path
string, with
.Pa /usr/libexec ,
.Pa /usr/games
.Pa /usr/libexec
and the current user's
.Ev $PATH
appended.
Expand Down
5 changes: 2 additions & 3 deletions usr.bin/whereis/whereis.c
Expand Up @@ -265,7 +265,7 @@ defaults(void)
opt_b = opt_m = opt_s = 1;

/* -b defaults to default path + /usr/libexec +
* /usr/games + user's path */
* user's path */
if (!bindirs) {
if (sysctlbyname("user.cs_path", (void *)NULL, &s,
(void *)NULL, 0) == -1)
Expand All @@ -276,11 +276,10 @@ defaults(void)
err(EX_OSERR, "sysctlbyname(\"user.cs_path\")");
nele = 0;
decolonify(b, &bindirs, &nele);
bindirs = realloc(bindirs, (nele + 3) * sizeof(char *));
bindirs = realloc(bindirs, (nele + 2) * sizeof(char *));
if (bindirs == NULL)
abort();
bindirs[nele++] = PATH_LIBEXEC;
bindirs[nele++] = PATH_GAMES;
bindirs[nele] = NULL;
if ((cp = getenv("PATH")) != NULL) {
/* don't destroy the original environment... */
Expand Down
1 change: 0 additions & 1 deletion usr.sbin/bsdconfig/include/messages.subr
Expand Up @@ -138,7 +138,6 @@ msg_ftp="FTP"
msg_ftp_desc="FTP client and server utilities."
msg_ftp_passive="FTP Passive"
msg_ftp_username="FTP username"
msg_games_desc="Various games and sundry amusements."
msg_generating_index_from_pkg_database="Generating INDEX from pkg(8) database\n(this can take a while)..."
msg_geography_desc="Geography-related software."
msg_german_desc="Ported software for Germanic countries."
Expand Down
2 changes: 1 addition & 1 deletion usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
Expand Up @@ -303,7 +303,7 @@ fetch_split_files()
OUTFILE="${FSMNT}/.fetch-${INSFILE}"
fi

DIRS="base catpages dict doc games info manpages proflibs kernels src"
DIRS="base catpages dict doc info manpages proflibs kernels src"
if [ "${FBSD_ARCH}" = "amd64" ]
then
DIRS="${DIRS} lib32"
Expand Down

0 comments on commit 11d9aa6

Please sign in to comment.