svn commit: r337849 - in head: bin/csh bin/sh etc etc/root
Rodney W. Grimes
freebsd at pdx.rh.CN85.dnsmgr.net
Wed Aug 15 16:26:11 UTC 2018
[ Charset UTF-8 unsupported, converting... ]
> Author: brd
> Date: Wed Aug 15 14:41:24 2018
> New Revision: 337849
> URL: https://svnweb.freebsd.org/changeset/base/337849
>
> Log:
> Move all sh and csh files into bin/sh/ or bin/csh/
>
> This simplifies pkgbase by migrating these to CONFS so they are properly
> tagged as config files.
This makes some other changes to the state
of the system beyond just moving these files to work with
installconf. Someone pointed at some of it, I commented
some on your review, further issues in this reply. One
issue in review figured out and is a none issue.
>
> Approved by: will (mentor)
> Differential Revision: https://reviews.freebsd.org/D16708
>
> Added:
> head/bin/csh/csh.cshrc
> - copied unchanged from r337848, head/etc/csh.cshrc
> head/bin/csh/csh.login
> - copied unchanged from r337848, head/etc/csh.login
> head/bin/csh/csh.logout
> - copied unchanged from r337848, head/etc/csh.logout
> head/bin/csh/dot.cshrc
> - copied unchanged from r337848, head/etc/root/dot.cshrc
> head/bin/csh/dot.login
> - copied unchanged from r337848, head/etc/root/dot.login
> head/bin/sh/dot.profile
> - copied unchanged from r337848, head/etc/root/dot.profile
> head/bin/sh/profile
> - copied unchanged from r337848, head/etc/profile
> Deleted:
> head/etc/csh.cshrc
> head/etc/csh.login
> head/etc/csh.logout
> head/etc/profile
> head/etc/root/dot.cshrc
> head/etc/root/dot.login
> head/etc/root/dot.profile
> Modified:
> head/bin/csh/Makefile
> head/bin/sh/Makefile
> head/etc/Makefile
>
> Modified: head/bin/csh/Makefile
> ==============================================================================
> --- head/bin/csh/Makefile Wed Aug 15 14:29:04 2018 (r337848)
> +++ head/bin/csh/Makefile Wed Aug 15 14:41:24 2018 (r337849)
> @@ -8,6 +8,11 @@
>
> .include <src.opts.mk>
>
> +CONFGROUPS= ETC ROOT
> +ETC= csh.cshrc csh.login csh.logout
> +ROOT= dot.cshrc
> +ROOTDIR= /root
> +ROOTNAME= .cshrc
> PACKAGE=runtime
> TCSHDIR= ${SRCTOP}/contrib/tcsh
> .PATH: ${TCSHDIR}
> @@ -44,7 +49,8 @@ MLINKS= csh.1 tcsh.1
>
> LIBADD= termcapw crypt
>
> -LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
> +LINKS= ${BINDIR}/csh ${BINDIR}/tcsh \
> + /root/.cshrc /.cshrc
>
> CLEANFILES= ${GENHDRS} gethost csh.1
>
> @@ -147,5 +153,12 @@ tc.const.h: tc.const.c sh.char.h config.h config_f.h s
> sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
> sort >> ${.TARGET}
> @echo '#endif /* _h_tc_const */' >> ${.TARGET}
> +
> +beforeinstall:
> + rm -f ${DESTDIR}/.cshrc
This target runs on ANY "install", this just blew away a custom /.cshrc
file and I did not ask this to be done. Should this be in a target
called beforeinstallconfig:?
> +
> +afterinstallconfig:
> + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
> + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
Ok, found out
where this comes into play, this is for MK_TCSH knob, which is pushed
up a level in the Makefile above, so this no longer needs if {MK_TCSH}
protection. Your review already fixes the reversal, so OK now.
Though I think it would be better to leave the edit in the way
it was done before (change csh to sh) in the src/bin/sh/Makefile
iff ${MK_TCSH} == no, this leaving the src/etc/master.passwd file
untouched by these changes. And ONLY needing the special edit
if someone builds without tcsh.
>
> .include <bsd.prog.mk>
>
> Copied: head/bin/csh/csh.cshrc (from r337848, head/etc/csh.cshrc)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/csh/csh.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.cshrc)
> @@ -0,0 +1,3 @@
> +# $FreeBSD$
> +#
> +# System-wide .cshrc file for csh(1).
>
> Copied: head/bin/csh/csh.login (from r337848, head/etc/csh.login)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/csh/csh.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.login)
> @@ -0,0 +1,15 @@
> +# $FreeBSD$
> +#
> +# System-wide .login file for csh(1).
> +# Uncomment this to give you the default 4.2 behavior, where disk
> +# information is shown in K-Blocks
> +# setenv BLOCKSIZE K
> +#
> +# For the setting of languages and character sets please see
> +# login.conf(5) and in particular the charset and lang options.
> +# For full locales list check /usr/share/locale/*
> +#
> +# Check system messages
> +# msgs -q
> +# Allow terminal messages
> +# mesg y
>
> Copied: head/bin/csh/csh.logout (from r337848, head/etc/csh.logout)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/csh/csh.logout Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/csh.logout)
> @@ -0,0 +1,3 @@
> +# $FreeBSD$
> +#
> +# System-wide .logout file for csh(1).
>
> Copied: head/bin/csh/dot.cshrc (from r337848, head/etc/root/dot.cshrc)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/csh/dot.cshrc Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.cshrc)
> @@ -0,0 +1,43 @@
> +# $FreeBSD$
> +#
> +# .cshrc - csh resource script, read at beginning of execution by each shell
> +#
> +# see also csh(1), environ(7).
> +# more examples available at /usr/share/examples/csh/
> +#
> +
> +alias h history 25
> +alias j jobs -l
> +alias la ls -aF
> +alias lf ls -FA
> +alias ll ls -lAF
> +
> +# A righteous umask
> +umask 22
> +
> +set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
> +
> +setenv EDITOR vi
> +setenv PAGER less
> +setenv BLOCKSIZE K
> +
> +if ($?prompt) then
> + # An interactive shell -- set some stuff up
> + set prompt = "%N@%m:%~ %# "
> + set promptchars = "%#"
> +
> + set filec
> + set history = 1000
> + set savehist = (1000 merge)
> + set autolist = ambiguous
> + # Use history to aid expansion
> + set autoexpand
> + set autorehash
> + set mail = (/var/mail/$USER)
> + if ( $?tcsh ) then
> + bindkey "^W" backward-delete-word
> + bindkey -k up history-search-backward
> + bindkey -k down history-search-forward
> + endif
> +
> +endif
>
> Copied: head/bin/csh/dot.login (from r337848, head/etc/root/dot.login)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/csh/dot.login Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.login)
> @@ -0,0 +1,12 @@
> +# $FreeBSD$
> +#
> +# .login - csh login script, read by login shell, after `.cshrc' at login.
> +#
> +# See also csh(1), environ(7).
> +#
> +
> +# Query terminal size; useful for serial lines.
> +if ( -x /usr/bin/resizewin ) /usr/bin/resizewin -z
> +
> +# Uncomment to display a random cookie on each login.
> +# if ( -x /usr/bin/fortune ) /usr/bin/fortune -s
>
> Modified: head/bin/sh/Makefile
> ==============================================================================
> --- head/bin/sh/Makefile Wed Aug 15 14:29:04 2018 (r337848)
> +++ head/bin/sh/Makefile Wed Aug 15 14:41:24 2018 (r337849)
> @@ -3,6 +3,9 @@
>
> .include <src.opts.mk>
>
> +CONFS= dot.profile profile
> +CONFSDIR_dot.profile= /root
> +CONFSNAME_dot.profile= .profile
> PACKAGE=runtime
> PROG= sh
> INSTALLFLAGS= -S
> @@ -34,6 +37,7 @@ WFORMAT=0
>
> CLEANFILES+= mknodes mksyntax
> CLEANFILES+= ${GENSRCS} ${GENHDRS}
> +LINKS= /root/.profile /.profile
>
> build-tools: mknodes mksyntax
>
> @@ -59,5 +63,8 @@ token.h: mktokens
>
> HAS_TESTS=
> SUBDIR.${MK_TESTS}+= tests
> +
> +beforeinstall:
> + rm -f ${DESTDIR}/.profile
As above, beforeinstallconfig???
> .include <bsd.prog.mk>
>
> Copied: head/bin/sh/dot.profile (from r337848, head/etc/root/dot.profile)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/sh/dot.profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/root/dot.profile)
> @@ -0,0 +1,16 @@
> +# $FreeBSD$
> +#
> +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
> +PAGER=less
> +export PAGER
> +
> +# Query terminal size; useful for serial lines.
> +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
> +
> +# Uncomment to display a random cookie on each login.
> +# if [ -x /usr/bin/fortune ] ; then /usr/bin/fortune -s ; fi
>
> Copied: head/bin/sh/profile (from r337848, head/etc/profile)
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/bin/sh/profile Wed Aug 15 14:41:24 2018 (r337849, copy of r337848, head/etc/profile)
> @@ -0,0 +1,18 @@
> +# $FreeBSD$
> +#
> +# System-wide .profile file for sh(1).
> +#
> +# Uncomment this to give you the default 4.2 behavior, where disk
> +# information is shown in K-Blocks
> +# BLOCKSIZE=K; export BLOCKSIZE
> +#
> +# For the setting of languages and character sets please see
> +# login.conf(5) and in particular the charset and lang options.
> +# For full locales list check /usr/share/locale/*
> +# You should also read the setlocale(3) man page for information
> +# on how to achieve more precise control of locale settings.
> +#
> +# Check system messages
> +# msgs -q
> +# Allow terminal messages
> +# mesg y
>
> Modified: head/etc/Makefile
> ==============================================================================
> --- head/etc/Makefile Wed Aug 15 14:29:04 2018 (r337848)
> +++ head/etc/Makefile Wed Aug 15 14:41:24 2018 (r337849)
> @@ -33,7 +33,6 @@ BIN1= crontab \
> networks \
> nsswitch.conf \
> phones \
> - profile \
> protocols \
> rc.bsdextended \
> rc.firewall \
> @@ -88,10 +87,6 @@ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
> BIN1+= rc.sendmail
> .endif
>
> -.if ${MK_TCSH} != "no"
> -BIN1+= csh.cshrc csh.login csh.logout
> -.endif
> -
> .if ${MK_WIRELESS} != "no"
> BIN1+= regdomain.xml
> .endif
> @@ -145,10 +140,6 @@ distribution:
> ${DESTDIR}/etc/services;
> .endif
>
> -.if ${MK_TCSH} == "no"
> - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
> -.endif
> - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
> .if defined(NO_ROOT)
> ( \
> echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
> @@ -190,20 +181,7 @@ distribution:
> ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
> dot.k5login ${DESTDIR}/root/.k5login;
> .endif
> - cd ${.CURDIR}/root; \
> - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
> - dot.profile ${DESTDIR}/root/.profile; \
> - rm -f ${DESTDIR}/.profile; \
> - ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
> -.if ${MK_TCSH} != "no"
> - cd ${.CURDIR}/root; \
> - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
> - dot.cshrc ${DESTDIR}/root/.cshrc; \
> - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
> - dot.login ${DESTDIR}/root/.login; \
> - rm -f ${DESTDIR}/.cshrc; \
> - ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
> -.endif
> +
> .if ${MK_MAIL} != "no"
> cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
> ${ETCMAIL} ${DESTDIR}/etc/mail
>
>
--
Rod Grimes rgrimes at freebsd.org
More information about the svn-src-all
mailing list