diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-02-04 05:27:35 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-02-04 05:27:35 +0000 |
commit | 2a9e28b5b44dd6b181110307b75fed764590b46e (patch) | |
tree | 211c1c315628f52b72b09b61e5ae6d92296e00c0 | |
parent | 0013e9ad985b226017f1abb5014e2b6e91414321 (diff) | |
download | portage-2a9e28b5b44dd6b181110307b75fed764590b46e.tar.gz portage-2a9e28b5b44dd6b181110307b75fed764590b46e.tar.bz2 portage-2a9e28b5b44dd6b181110307b75fed764590b46e.zip |
touchup code so we handle errors better
svn path=/main/trunk/; revision=2651
-rwxr-xr-x | bin/newconfd | 10 | ||||
-rwxr-xr-x | bin/newenvd | 10 | ||||
-rwxr-xr-x | bin/newinitd | 10 |
3 files changed, 15 insertions, 15 deletions
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}" |