From owner-freebsd-current@FreeBSD.ORG Fri Aug 27 15:24:40 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF81C16A4D0 for ; Fri, 27 Aug 2004 15:24:40 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F3FF43D53 for ; Fri, 27 Aug 2004 15:24:40 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: by mproxy.gmail.com with SMTP id 77so224363rnl for ; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Received: by 10.38.15.69 with SMTP id 69mr2485511rno; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Received: by 10.38.75.25 with HTTP; Fri, 27 Aug 2004 08:24:39 -0700 (PDT) Message-ID: <790a9fff0408270824750baf89@mail.gmail.com> Date: Fri, 27 Aug 2004 10:24:39 -0500 From: Scot Hetzel To: dougb@freebsd.org In-Reply-To: <790a9fff04081715382b449355@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_13_21427464.1093620279340" References: <20040817223335.F2E3B5D04@ptavv.es.net> <790a9fff04081715382b449355@mail.gmail.com> cc: freebsd-rc@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)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Scot Hetzel List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 15:24:41 -0000 ------=_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 wrote: > On Tue, 17 Aug 2004 15:33:35 -0700, Kevin Oberman wrote: > > > Date: Tue, 17 Aug 2004 17:24:27 -0500 > > > From: Scot Hetzel > > > > > > > > > > On Tue, 17 Aug 2004 14:58:14 -0700, Kevin Oberman 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--