Date: Fri, 27 Aug 2004 10:24:39 -0500 From: Scot Hetzel <swhetzel@gmail.com> To: dougb@freebsd.org Cc: current@freebsd.org Subject: Patch for mergemaster [was Re: RFC: Alternate patch to have true new-style rc.d scripts in ports (without touching localpkg)] Message-ID: <790a9fff0408270824750baf89@mail.gmail.com> In-Reply-To: <790a9fff04081715382b449355@mail.gmail.com> References: <20040817223335.F2E3B5D04@ptavv.es.net> <790a9fff04081715382b449355@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tue, 17 Aug 2004 17:38:03 -0500, Scot Hetzel <swhetzel@gmail.com> wrote:
> On Tue, 17 Aug 2004 15:33:35 -0700, Kevin Oberman <oberman@es.net> wrote:
> > > Date: Tue, 17 Aug 2004 17:24:27 -0500
> > > From: Scot Hetzel <swhetzel@gmail.com>
> >
> >
> > >
> > > On Tue, 17 Aug 2004 14:58:14 -0700, Kevin Oberman <oberman@es.net> wrote:
> > > > > It is best to leave the moving of these scripts up to the individual
> > > > > administrator.
> > > >
> > > > Only if mergemaster is fixed!
> > > >
> > > This could be fixed by adding:
> > >
> > > # KEYWORD: FreeBSD PORT
> > >
> > > to each startup script. Then making mergemaster ignore any script
> > > that has PORT in the KEYWORD line.
> >
> > Yes, this would work, although I would prefer:
> > # KEYWORD: FreeBSD USER
> > since some systems might want to add scripts to rc.local that are not
> > from ports.
> >
> Another option is to use:
> # KEYWORD: FreeBSD SYSTEM
>
> for system startup scripts and only have mergemaster look at scripts
> with SYSTEM as KEYWORD.
>
Several individuals expressed their concern with mergemaster deleting
scripts from /etc/rc.d. The main concern is that an administator
could create their own scripts and place them into /etc/rc.d, then
either they forget about their script, or another admin is updating
and they accidently delete the script during the mergemaster process.
Attached is a patch to mergemaster that checks the script files for
"$FreeBSD: src" during the STALE_RC_FILES check. If a script has such
a header, it is assumed to be a stale rc file. The old behavior of
checking all scripts is still available when the -s flag is specified
to mergemaster.
I have EXTRA_RC_FILES, but it currently doesn't do anything with them.
Scot
Index: mergemaster.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v
retrieving revision 1.51
diff -u -r1.51 mergemaster.sh
--- mergemaster.sh 7 Mar 2004 10:10:19 -0000 1.51
+++ mergemaster.sh 26 Aug 2004 08:54:54 -0000
@@ -790,7 +790,18 @@
cd "${DESTDIR}/etc/rc.d" &&
for file in *; do
if [ ! -e "${TEMPROOT}/etc/rc.d/${file}" ]; then
- STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ case "${STRICT}" in
+ [Yy][Ee][Ss])
+ STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ ;;
+ '' | [Nn][Oo])
+ if grep -c "[$]${CVS_ID_TAG}: src" ${file} ; then
+ STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ else
+ EXTRA_RC_FILES="${EXTRA_RC_FILES} ${file}"
+ fi
+ ;;
+ esac
fi
done
case "${STALE_RC_FILES}" in
[-- Attachment #2 --]
To: DougB@FreeBSD.org, FreeBSD-Current@FreeBSD.org
Subject:
Index: mergemaster.sh
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mergemaster/mergemaster.sh,v
retrieving revision 1.51
diff -u -r1.51 mergemaster.sh
--- mergemaster.sh 7 Mar 2004 10:10:19 -0000 1.51
+++ mergemaster.sh 26 Aug 2004 08:54:54 -0000
@@ -790,7 +790,18 @@
cd "${DESTDIR}/etc/rc.d" &&
for file in *; do
if [ ! -e "${TEMPROOT}/etc/rc.d/${file}" ]; then
- STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ case "${STRICT}" in
+ [Yy][Ee][Ss])
+ STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ ;;
+ '' | [Nn][Oo])
+ if grep -c "[$]${CVS_ID_TAG}: src" ${file} ; then
+ STALE_RC_FILES="${STALE_RC_FILES} ${file}"
+ else
+ EXTRA_RC_FILES="${EXTRA_RC_FILES} ${file}"
+ fi
+ ;;
+ esac
fi
done
case "${STALE_RC_FILES}" in
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0408270824750baf89>
