Subject: review wanted: su/cvs return code checking (resend)
To: None <tech-pkg@netbsd.org>
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
List: tech-pkg
Date: 11/24/2003 20:47:59
Seems either my mail didn't make it through or any replies got lost... can
someone please comment on the diff below?


 - Hubert

-- 
  ___ _ _  _   _        * Harddisk Image Cloning *
 / __| | || | | |           www.feyrer.de/g4u/
| (_ |_  _| |_| |
 \___| |_| \___/          v1.12 out now, including partition support!

---------- Forwarded message ----------
Date: Sat, 22 Nov 2003 12:57:27 +0100 (CET)
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
To: tech-pkg@netbsd.org
Subject: review wanted: su/cvs return code checking


I'd like to catch if the user given to "su" is bogus/non-existing, but if
the "cvs" command inside the su returns an error, that should be ignored.
(Aparently cvs returns "1" even if it's done a successful update but if
there were some files removed on purpose).

Can anyone please let me know if the following patch makes sense, or if
there's a better way:

--- pre-build	20 Nov 2003 00:02:59 -0000	1.31
+++ pre-build	22 Nov 2003 11:46:39 -0000
@@ -148,7 +148,7 @@
 		( cd ${USR_PKGSRC}/security/ssh ; ${BMAKE} bulk-install )
 	fi
 	echo Performing CVS update - this will take some time
-	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd '"${CVS_FLAGS}"
+	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd '"${CVS_FLAGS}"' || exit 0'
         if [ $? != 0 ]
         then
                 echo CVS update not successful, aborting.

Thanks,

	Hubert

-- 
  ___ _ _  _   _        * Harddisk Image Cloning *
 / __| | || | | |           www.feyrer.de/g4u/
| (_ |_  _| |_| |
 \___| |_| \___/          v1.12 out now, including partition support!