From owner-freebsd-bugs Fri Oct 11 6:10: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A5CB37B401 for ; Fri, 11 Oct 2002 06:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A59643E91 for ; Fri, 11 Oct 2002 06:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BDA2Co002153 for ; Fri, 11 Oct 2002 06:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9BDA2tk002152; Fri, 11 Oct 2002 06:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AD3C37B401 for ; Fri, 11 Oct 2002 06:06:58 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99F7443E91 for ; Fri, 11 Oct 2002 06:06:57 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BD6r7R055036 for ; Fri, 11 Oct 2002 06:06:53 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g9BD6r9f055035; Fri, 11 Oct 2002 06:06:53 -0700 (PDT) Message-Id: <200210111306.g9BD6r9f055035@www.freebsd.org> Date: Fri, 11 Oct 2002 06:06:53 -0700 (PDT) From: Jason Li To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/43928: [PATCH]mergemaster in -STABLE produces unnecessary output Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43928 >Category: misc >Synopsis: [PATCH]mergemaster in -STABLE produces unnecessary output >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Oct 11 06:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jason Li >Release: 4.7-STABLE >Organization: Frontfree Technology Network >Environment: FreeBSD mail.frontfree.net 4.7-STABLE FreeBSD 4.7-STABLE #12: Fri Oct 11 14:50:12 CST 2002 delphij@mail.frontfree.net:/usr/obj/usr/src/sys/MAIL i386 >Description: The mergemaster(8) utility helps us to merge configuration files. There's the following code in the mergemaster program itself: delete_temproot () { rm -rf "${TEMPROOT}" chflags -R 0 "${TEMPROOT}" rm -rf "${TEMPROOT}" } When running the mergemaster utility, it will give the following message at the final stage of its execution rm: /var/tmp/temproot/var/empty: Operation not permitted rm: /var/tmp/temproot/var: Directory not empty rm: /var/tmp/temproot: Directory not empty *** /var/tmp/temproot has been deleted I think the first 3 lines are not desired, because in -CURRENT there's not such lines, while not outputing these lines doesn't produce any things which affects stablity. My solution is to copy delete_temproot from -CURRENT code to -STABLE. The difference between the -stable and -current(which is included below) is mainly about the output. In -current, no error message will go to user console, while if there's some error, the script will stop. This behavior is correct and the change won't affect stablity of -STABLE. The schg flag for temproot/empty will obviously cause rm to output error message, which is not what user need because the problem will soon solved by chflags. >How-To-Repeat: mergemaster under -STABLE >Fix: Here is a diff between my patched mergemaster script under src[src/usr.sbin/mergemaster/mergemaster.sh] and the original one: --- mergemaster.sh.orig Fri Oct 11 21:00:21 2002 +++ mergemaster.sh Fri Oct 11 21:00:57 2002 @@ -398,9 +398,9 @@ CVS_ID_TAG=FreeBSD delete_temproot () { - rm -rf "${TEMPROOT}" - chflags -R 0 "${TEMPROOT}" - rm -rf "${TEMPROOT}" + rm -rf "${TEMPROOT}" 2>/dev/null + chflags -R 0 "${TEMPROOT}" 2>/dev/null + rm -rf "${TEMPROOT}" || exit 1 } case "${RERUN}" in >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message