Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc Ensure that the exit status in do_obsolete() is correctl...



details:   https://anonhg.NetBSD.org/src/rev/28eac83f8e79
branches:  trunk
changeset: 547079:28eac83f8e79
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue May 13 02:41:27 2003 +0000

description:
Ensure that the exit status in do_obsolete() is correctly determined.
Problem introduced in previous, and noticed by Rob Quinn in private email.

diffstat:

 etc/postinstall |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 430d039c5678 -r 28eac83f8e79 etc/postinstall
--- a/etc/postinstall   Tue May 13 02:13:14 2003 +0000
+++ b/etc/postinstall   Tue May 13 02:41:27 2003 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.59 2003/05/10 10:20:31 lukem Exp $
+# $NetBSD: postinstall,v 1.60 2003/05/13 02:41:27 lukem Exp $
 #
 # Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -655,9 +655,8 @@
        [ -n "$1" ] || err 2 "USAGE: do_obsolete  fix|check"
        op=$1
 
-       failed=0
-
-       sort -ru ${DEST_DIR}/var/db/obsolete/* |
+       sort -ru ${DEST_DIR}/var/db/obsolete/* | (
+               failed=0
                while read ofile; do
                        ofile=${DEST_DIR}${ofile#.}
                        cmd="rm"
@@ -680,8 +679,10 @@
                                msg "Removed obsolete ${ftype} ${ofile}"
                        fi
                done
+               exit ${failed}
+       )
 
-       return ${failed}
+       return $?
 }
 
 #



Home | Main Index | Thread Index | Old Index