touchup code so we handle errors better
authorMike Frysinger <vapier@gentoo.org>
Sat, 4 Feb 2006 05:33:22 +0000 (05:33 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 4 Feb 2006 05:33:22 +0000 (05:33 -0000)
svn path=/main/trunk/; revision=2653

bin/newbin
bin/newdoc
bin/newexe
bin/newins
bin/newlib.a
bin/newlib.so
bin/newman
bin/newsbin

index a5749ce268f210769f591e5877dedbb2fec85556..699b9a6870f0009ebf710fd500d22ab21bced42d 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newbin,v 1.7 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}"
-dobin "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec dobin "${T}/${2}"
index 456aaa90d72b4c69a42adaa5bde1e82414e30b16..d3b83565bb150e61b4e231610dceacae2cbd5163 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.7 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}"
-dodoc "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec dodoc "${T}/${2}"
index 00c2fb7653a9ceda1f8bde87eb2e672be177b402..ce3a08231a2d2fd3afcff8f16ca063caf9555ac8 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newexe,v 1.7 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}"
-doexe "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doexe "${T}/${2}"
index 81ab5662d17945e5f8e45eacca390cab4abdf9f6..8dcbd99c1b20cda67c8c553c1821caec02655576 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newins,v 1.7 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Error: 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}"
-doins "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doins "${T}/${2}"
index 914eb49dcc582a917139cccea8757e1418960d2a..0f9b45d9b0d5d54d33f3613fefbe332fb0d851f4 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newlib.a,v 1.7 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Error: 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}"
-dolib.a "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec dolib.a "${T}/${2}"
index 6e0f7bd25a51f719d08363e816556d4eeb5d10b6..a756068ef9b7467bffa14a1a2feebcce2cf16348 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newlib.so,v 1.7 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Error: 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}"
-dolib.so "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec dolib.so "${T}/${2}"
index 14349a9d787744f9352b67bf6a1cef22a9847243..24a4757ecd73cfc9016585647dc627e2880021d0 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newman,v 1.7 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}"
-doman "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doman "${T}/${2}"
index a2413e44413c3940d7ed223a6190d3456686e1cc..ec043dbcad1cf993d551d2bd681a1ad76de242de 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newsbin,v 1.7 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}"
-dosbin "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec dosbin "${T}/${2}"