From: Mike Frysinger Date: Sat, 4 Feb 2006 05:27:35 +0000 (-0000) Subject: touchup code so we handle errors better X-Git-Tag: v2.1_pre5_2760~93 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a9e28b5b44dd6b181110307b75fed764590b46e;p=portage.git touchup code so we handle errors better svn path=/main/trunk/; revision=2651 --- diff --git a/bin/newconfd b/bin/newconfd index cb30ec6e2..63a38bb78 100755 --- a/bin/newconfd +++ b/bin/newconfd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newconfd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doconfd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doconfd "${T}/${2}" diff --git a/bin/newenvd b/bin/newenvd index ced17098d..07bbec644 100755 --- a/bin/newenvd +++ b/bin/newenvd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newenvd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doenvd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doenvd "${T}/${2}" diff --git a/bin/newinitd b/bin/newinitd index c6513460b..50a4d54d7 100755 --- a/bin/newinitd +++ b/bin/newinitd @@ -3,11 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/newinitd,v 1.2 2004/10/04 13:56:50 vapier Exp $ -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." +if [[ -z ${T} ]] || [[ -z ${2} ]] ; then + echo "$0: Need two arguments, old file and new file" 1>&2 exit 1 fi -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doinitd "${T}/${2}" +rm -rf "${T}/${2}" && \ +cp -f "${1}" "${T}/${2}" && \ +exec doinitd "${T}/${2}"