Skip site navigation (1)Skip section navigation (2)
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
------=_Part_13_21427464.1093620279340
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_13_21427464.1093620279340
Content-Type: application/octet-stream; name="mergemaster.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mergemaster.diff"

VG86IERvdWdCQEZyZWVCU0Qub3JnLCBGcmVlQlNELUN1cnJlbnRARnJlZUJTRC5vcmcKU3ViamVj
dDoKCkluZGV4OiBtZXJnZW1hc3Rlci5zaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvaG9tZS9uY3Zz
L3NyYy91c3Iuc2Jpbi9tZXJnZW1hc3Rlci9tZXJnZW1hc3Rlci5zaCx2CnJldHJpZXZpbmcgcmV2
aXNpb24gMS41MQpkaWZmIC11IC1yMS41MSBtZXJnZW1hc3Rlci5zaAotLS0gbWVyZ2VtYXN0ZXIu
c2gJNyBNYXIgMjAwNCAxMDoxMDoxOSAtMDAwMAkxLjUxCisrKyBtZXJnZW1hc3Rlci5zaAkyNiBB
dWcgMjAwNCAwODo1NDo1NCAtMDAwMApAQCAtNzkwLDcgKzc5MCwxOCBAQAogICBjZCAiJHtERVNU
RElSfS9ldGMvcmMuZCIgJiYKICAgZm9yIGZpbGUgaW4gKjsgZG8KICAgICBpZiBbICEgLWUgIiR7
VEVNUFJPT1R9L2V0Yy9yYy5kLyR7ZmlsZX0iIF07IHRoZW4KLSAgICAgIFNUQUxFX1JDX0ZJTEVT
PSIke1NUQUxFX1JDX0ZJTEVTfSAke2ZpbGV9IgorICAgICAgY2FzZSAiJHtTVFJJQ1R9IiBpbgor
ICAgICAgW1l5XVtFZV1bU3NdKQorICAgICAgICBTVEFMRV9SQ19GSUxFUz0iJHtTVEFMRV9SQ19G
SUxFU30gJHtmaWxlfSIKKyAgICAgICAgOzsKKyAgICAgICcnIHwgW05uXVtPb10pCisgICAgICAg
IGlmIGdyZXAgLWMgIlskXSR7Q1ZTX0lEX1RBR306IHNyYyIgJHtmaWxlfSA7IHRoZW4KKyAgICAg
ICAgICBTVEFMRV9SQ19GSUxFUz0iJHtTVEFMRV9SQ19GSUxFU30gJHtmaWxlfSIKKyAgICAgICAg
ZWxzZQorICAgICAgICAgIEVYVFJBX1JDX0ZJTEVTPSIke0VYVFJBX1JDX0ZJTEVTfSAke2ZpbGV9
IgorICAgICAgICBmaQorICAgICAgICA7OworICAgICAgZXNhYwogICAgIGZpCiAgIGRvbmUKICAg
Y2FzZSAiJHtTVEFMRV9SQ19GSUxFU30iIGluCg==
------=_Part_13_21427464.1093620279340--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0408270824750baf89>