Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 78796 Details for
Bug 121317
helpers should do error checking
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
install as much as possible, then exit appropriately
helpers_error_checking.patch (text/plain), 7.92 KB, created by
Simon Stelling (RETIRED)
on 2006-02-03 03:52:33 UTC
(
hide
)
Description:
install as much as possible, then exit appropriately
Filename:
MIME Type:
Creator:
Simon Stelling (RETIRED)
Created:
2006-02-03 03:52:33 UTC
Size:
7.92 KB
patch
obsolete
>Index: bin/doconfd >=================================================================== >--- bin/doconfd (revision 2640) >+++ bin/doconfd (working copy) >@@ -10,6 +10,6 @@ > > tmp_INSDESTTREE="${INSDESTTREE}" > INSDESTTREE=/etc/conf.d/ >-doins "$@" >+doins "$@" || exit 2 > INSDESTTREE="${tmp_INSDESTTREE}" > unset tmp_INSDESTTREE >Index: bin/dodir >=================================================================== >--- bin/dodir (revision 2640) >+++ bin/dodir (working copy) >@@ -3,6 +3,9 @@ > # Distributed under the terms of the GNU General Public License v2 > # $Id: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $ > >+ret=0 > for x in "$@" ; do >- install -d ${DIROPTIONS} "${D}${x}" >+ install -d ${DIROPTIONS} "${D}${x}" || ((++ret)) > done >+ >+exit ${ret} >Index: bin/dodoc >=================================================================== >--- bin/dodoc (revision 2640) >+++ bin/dodoc (working copy) >@@ -9,14 +9,14 @@ > > dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}" > if [ ! -d "${dir}" ] ; then >- install -d "${dir}" >+ install -d "${dir}" || exit 2 > fi > > ret=0 > for x in "$@" ; do > if [ -s "${x}" ] ; then >- install -m0644 "${x}" "${dir}" >- gzip -f -9 "${dir}/${x##*/}" >+ install -m0644 "${x}" "${dir}" || ((++ret)) >+ gzip -f -9 "${dir}/${x##*/}" || ((++ret)) > elif [ ! -e "${x}" ] ; then > echo "dodoc: ${x} does not exist" 1>&2 > ((++ret)) >Index: bin/doenvd >=================================================================== >--- bin/doenvd (revision 2640) >+++ bin/doenvd (working copy) >@@ -10,6 +10,6 @@ > > tmp_INSDESTTREE="${INSDESTTREE}" > INSDESTTREE=/etc/env.d/ >-doins "$@" >+doins "$@" || exit 2 > INSDESTTREE="${tmp_INSDESTTREE}" > unset tmp_INSDESTTREE >Index: bin/doexe >=================================================================== >--- bin/doexe (revision 2640) >+++ bin/doexe (working copy) >@@ -3,24 +3,26 @@ > # Distributed under the terms of the GNU General Public License v2 > # $Id: /var/cvsroot/gentoo-src/portage/bin/doexe,v 1.10.2.1 2004/12/06 03:01:43 carpaski Exp $ > >-mynum=${#} >-if [ ${mynum} -lt 1 ] ; then >+if [ ${#} -lt 1 ] ; then > echo "doexe: at least one argument needed" > exit 1 > fi > if [ ! -d "${D}${EXEDESTTREE}" ] ; then >- install -d "${D}${EXEDESTTREE}" >+ install -d "${D}${EXEDESTTREE}" || exit 2 > fi > >-for x in "$@" ; do >+ret=0 >+for x in "${@}" ; do > if [ -L "${x}" ] ; then > cp "${x}" "${T}" >- mysrc="${T}"/`/usr/bin/basename "${x}"` >+ mysrc="${T}"/$(/usr/bin/basename "${x}") > elif [ -d "${x}" ] ; then > echo "doexe: warning, skipping directory ${x}" > continue > else > mysrc="${x}" > fi >- install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" >+ install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" || ((++ret)) > done >+ >+exit ${ret} >Index: bin/doinfo >=================================================================== >--- bin/doinfo (revision 2640) >+++ bin/doinfo (working copy) >@@ -8,14 +8,17 @@ > exit 1 > fi > if [ ! -d "${D}usr/share/info" ] ; then >- install -d "${D}usr/share/info" >+ install -d "${D}usr/share/info" || exit 2 > fi > >+ret=0 > for x in "$@" ; do > if [ -e "${x}" ] ; then >- install -m0644 "${x}" "${D}usr/share/info" >- gzip -f -9 "${D}usr/share/info/${x##*/}" >+ install -m0644 "${x}" "${D}usr/share/info" || ((++ret)) >+ gzip -f -9 "${D}usr/share/info/${x##*/}" || ((++ret)) > else > echo "doinfo: ${x} does not exist" > fi > done >+ >+exit ${ret} >Index: bin/doinitd >=================================================================== >--- bin/doinitd (revision 2640) >+++ bin/doinitd (working copy) >@@ -10,6 +10,6 @@ > > tmp_EXEDESTTREE="${EXEDESTTREE}" > EXEDESTTREE=/etc/init.d/ >-doexe "$@" >+doexe "$@" || exit 2 > EXEDESTTREE="${tmp_EXEDESTTREE}" > unset tmp_EXEDESTTREE >Index: bin/doins >=================================================================== >--- bin/doins (revision 2640) >+++ bin/doins (working copy) >@@ -28,8 +28,11 @@ > #exit 1 > fi > >-[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}" >+if [ ! -d "${D}${INSDESTTREE}" ]; then >+ dodir "${INSDESTTREE}" || exit 2 >+fi > >+ret=0 > for x in "$@" ; do > if [ -L "$x" ] ; then > cp "$x" "${T}" >@@ -44,10 +47,12 @@ > env \ > INSDESTTREE="${mydir}" \ > INSDEPTH=$((INSDEPTH+1)) \ >- doins -r {} \; >+ doins -r {} \; || ((++ret)) > continue > else > mysrc="${x}" > fi >- install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" >+ install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" || ((++ret)) > done >+ >+exit ${ret} >Index: bin/dojar >=================================================================== >--- bin/dojar (revision 2640) >+++ bin/dojar (working copy) >@@ -34,13 +34,14 @@ > jardest="${DESTTREE}/share/${PN}/${JARDESTTREE}/" > pf="${D}${jarroot}/package.env" > >-dodir "${jardest}" >+dodir "${jardest}" || exit 1 > >+ret=0 > for i in $* ; do > bn="$(basename $i)" > > if [ -f "$pf" ] ; then >- oldcp=`grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//"` >+ oldcp=$(grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//") > grep -v "CLASSPATH=" "$pf" > "${pf}.new" > echo "CLASSPATH=${oldcp}:${jardest}${bn}" >> "${pf}.new" > mv "${pf}.new" "$pf" >@@ -50,5 +51,7 @@ > fi > > cp "$i" "${D}${jardest}/" >- chmod 0444 "${D}${jardest}/${bn}" >+ chmod 0444 "${D}${jardest}/${bn}" || ((++ret)) > done >+ >+exit ${ret} >Index: bin/dolib >=================================================================== >--- bin/dolib (revision 2640) >+++ bin/dolib (working copy) >@@ -25,17 +25,20 @@ > exit 1 > fi > if [ ! -d "${libdir}" ] ; then >- install -d "${libdir}" >+ install -d "${libdir}" || exit 1 > fi > >+ret=0 > for x in "$@" ; do > if [ -e "${x}" ] ; then > if [ ! -L "${x}" ] ; then >- install ${LIBOPTIONS} "${x}" "${libdir}" >+ install ${LIBOPTIONS} "${x}" "${libdir}" || ((++ret)) > else >- ln -s "$(readlink "${x}")" "${libdir}/${x}" >+ ln -s "$(readlink "${x}")" "${libdir}/${x}" || ((++ret)) > fi > else > echo "${0}: ${x} does not exist" > fi > done >+ >+exit ${ret} >Index: bin/doman >=================================================================== >--- bin/doman (revision 2640) >+++ bin/doman (working copy) >@@ -11,6 +11,7 @@ > BASE="/usr/share" > i18n="" > >+ret=0 > for x in "$@" ; do > if [ "${x:0:6}" == "-i18n=" ] ; then > i18n="${x:6}/" >@@ -36,13 +37,13 @@ > if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then > if [ -s "${x}" ] ; then > if [ ! -d "${D}${BASE}/man/${mandir}" ] ; then >- install -d "${D}${BASE}/man/${mandir}" >+ install -d "${D}${BASE}/man/${mandir}" || ((++ret)) > fi > >- install -m0644 "${x}" "${D}${BASE}/man/${mandir}" >+ install -m0644 "${x}" "${D}${BASE}/man/${mandir}" || ((++ret)) > > if [ -z "${compressed}" ] ; then >- gzip -f -9 "${D}${BASE}/man/${mandir}/${x##*/}" >+ gzip -f -9 "${D}${BASE}/man/${mandir}/${x##*/}" || ((++ret)) > fi > else > echo "doman: ${x} does not exist" 1>&2 >@@ -51,3 +52,5 @@ > echo "doman: '${x}' is probably not a man page; skipping" 1>&2 > fi > done >+ >+exit ${ret} >Index: bin/domo >=================================================================== >--- bin/domo (revision 2640) >+++ bin/domo (working copy) >@@ -9,18 +9,21 @@ > exit 1 > fi > if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then >- install -d "${D}${DESTTREE}/share/locale/" >+ install -d "${D}${DESTTREE}/share/locale/" || exit 1 > fi > >+ret=0 > for x in "$@" ; do > if [ -e "${x}" ] ; then > mytiny="${x##*/}" > mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES" > if [ ! -d "${mydir}" ] ; then >- install -d "${mydir}" >+ install -d "${mydir}" || ((++ret)) > fi >- install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" >+ install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" || ((++ret)) > else > echo "${0}: ${x} does not exist" > fi > done >+ >+exit ${ret} >Index: bin/dosed >=================================================================== >--- bin/dosed (revision 2640) >+++ bin/dosed (working copy) >@@ -5,13 +5,14 @@ > > mysed="s:${D}::g" > >+ret=0 > for x in "$@" ; do > y="${D}${x}" > if [ -a "${y}" ] ; then > if [ -f "${y}" ] ; then > mysrc="${T}/${y##*/}" > cp "${y}" "${mysrc}" >- sed -e "${mysed}" "${mysrc}" > "${y}" >+ sed -e "${mysed}" "${mysrc}" > "${y}" || ((++ret)) > else > echo "${y} is not a regular file!" > exit 1 >@@ -20,3 +21,5 @@ > mysed="${x}" > fi > done >+ >+exit ${ret}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 121317
:
78734
| 78796