`` must die
authorSimon Stelling <blubb@gentoo.org>
Sat, 15 Apr 2006 18:42:28 +0000 (18:42 -0000)
committerSimon Stelling <blubb@gentoo.org>
Sat, 15 Apr 2006 18:42:28 +0000 (18:42 -0000)
svn path=/main/trunk/; revision=3155

bin/doexe
bin/dojar
bin/ebuild.sh
bin/etc-update
bin/find-requires
bin/isolated-functions.sh
bin/misc-functions.sh
bin/prepalldocs
bin/prepinfo
bin/quickpkg

index aa87f787e5584b30d11fc4b858e63389e4aa1827..94952776807acab4841d01a6a48c2ea09c4852d3 100755 (executable)
--- a/bin/doexe
+++ b/bin/doexe
@@ -15,7 +15,7 @@ fi
 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
index 8ed9285bb405cf5c5f27d42bcab253e96c704d5b..e61015ef6312e714c3cf4b00096281a57b6bb8fb 100755 (executable)
--- a/bin/dojar
+++ b/bin/dojar
@@ -40,7 +40,7 @@ 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"
index 814d9da58ca7981b7ec9eca816eecf562167dae7..82699119c812c54c9650d63fc9c358b6c76f1772 100755 (executable)
@@ -579,7 +579,7 @@ pkg_nofetch() {
 
        echo "!!! The following are listed in SRC_URI for ${PN}:"
        local x
-       for x in `echo ${SRC_URI}`; do
+       for x in $(echo ${SRC_URI}); do
                echo "!!!   ${x}"
        done
 }
@@ -1407,7 +1407,7 @@ QA_INTERCEPTORS="javac java-config python python-config perl grep egrep fgrep se
 # level the QA interceptors if we're in depend
 if hasq "depend" "$@"; then
        for BIN in ${QA_INTERCEPTORS}; do
-               BIN_PATH=`type -pf ${BIN}`
+               BIN_PATH=$(type -pf ${BIN})
                if [ "$?" != "0" ]; then
                        BODY="echo \"*** missing command: ${BIN}\" >&2; return 127"
                else
@@ -1561,29 +1561,29 @@ for myarg in $*; do
                # Make it group writable. 666&~002==664
                umask 002
 
-               #the extra `echo` commands remove newlines
-               echo `echo "$DEPEND"`       > $dbkey
-               echo `echo "$RDEPEND"`     >> $dbkey
-               echo `echo "$SLOT"`        >> $dbkey
-               echo `echo "$SRC_URI"`     >> $dbkey
-               echo `echo "$RESTRICT"`    >> $dbkey
-               echo `echo "$HOMEPAGE"`    >> $dbkey
-               echo `echo "$LICENSE"`     >> $dbkey
-               echo `echo "$DESCRIPTION"` >> $dbkey
-               echo `echo "$KEYWORDS"`    >> $dbkey
-               echo `echo "$INHERITED"`   >> $dbkey
-               echo `echo "$IUSE"`        >> $dbkey
+               #the extra $(echo) commands remove newlines
+               echo $(echo "$DEPEND")       > $dbkey
+               echo $(echo "$RDEPEND")     >> $dbkey
+               echo $(echo "$SLOT")        >> $dbkey
+               echo $(echo "$SRC_URI")     >> $dbkey
+               echo $(echo "$RESTRICT")    >> $dbkey
+               echo $(echo "$HOMEPAGE")    >> $dbkey
+               echo $(echo "$LICENSE")     >> $dbkey
+               echo $(echo "$DESCRIPTION") >> $dbkey
+               echo $(echo "$KEYWORDS")    >> $dbkey
+               echo $(echo "$INHERITED")   >> $dbkey
+               echo $(echo "$IUSE")        >> $dbkey
                echo                       >> $dbkey
-               echo `echo "$PDEPEND"`     >> $dbkey
-               echo `echo "$PROVIDE"`     >> $dbkey
-               echo `echo "${EAPI:-0}"`   >> $dbkey
-               echo `echo "$UNUSED_01"`   >> $dbkey
-               echo `echo "$UNUSED_02"`   >> $dbkey
-               echo `echo "$UNUSED_03"`   >> $dbkey
-               echo `echo "$UNUSED_04"`   >> $dbkey
-               echo `echo "$UNUSED_05"`   >> $dbkey
-               echo `echo "$UNUSED_06"`   >> $dbkey
-               echo `echo "$UNUSED_07"`   >> $dbkey
+               echo $(echo "$PDEPEND")     >> $dbkey
+               echo $(echo "$PROVIDE")     >> $dbkey
+               echo $(echo "${EAPI:-0}")   >> $dbkey
+               echo $(echo "$UNUSED_01")   >> $dbkey
+               echo $(echo "$UNUSED_02")   >> $dbkey
+               echo $(echo "$UNUSED_03")   >> $dbkey
+               echo $(echo "$UNUSED_04")   >> $dbkey
+               echo $(echo "$UNUSED_05")   >> $dbkey
+               echo $(echo "$UNUSED_06")   >> $dbkey
+               echo $(echo "$UNUSED_07")   >> $dbkey
                set +f
                #make sure it is writable by our group:
                exit 0
index a8bf13325d299612244da80193aa14c14b2a5453..2600ed8131e77439822c185fb127e5d4f92cd33d 100755 (executable)
@@ -44,11 +44,11 @@ function scan() {
                [ ! -d ${path} ] && continue
 
                ofile=""
-               for file in `find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
+               for file in $(find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
                           sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
-                          sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'`; do
-                       rpath=`echo "${file/\/\///}" | sed -e "s:/[^/]*$::"`
-                       rfile=`echo "${file/\/\///}" | sed -e "s:^.*/::"`
+                          sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
+                       rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
+                       rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
                        for mpath in ${CONFIG_PROTECT_MASK}; do
                                if [[ "${rpath}" == "${mpath}"* ]]; then
                                        mv ${rpath}/${rfile} ${rpath}/${rfile:10}
@@ -68,8 +68,8 @@ function scan() {
                                                diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$'
                                                MATCHES=$?
                                        fi
-                               elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
-                                                         grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
+                               elif [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
+                                                         grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
                                        MATCHES=1
                                fi
                                if [[ "${MATCHES}" == "1" ]]; then
@@ -86,8 +86,8 @@ function scan() {
                                fi
                        fi
 
-                       if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
-                                         grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
+                       if [[ -z $(diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
+                                         grep "^[+-][^+-]"|grep -v '# .Header:.*') ]]; then
                                mv ${rpath}/${rfile} ${rpath}/${ofile}
                                continue
                        else
@@ -192,7 +192,7 @@ function do_file() {
                                        read my_input
                                else
                                        dialog --title "${title}" --menu "${my_title}" \
-                                               0 0 0 `echo -e "$(<${TMP}/menuitems)\n${fcount} Exit"` \
+                                               0 0 0 $(echo -e "$(<${TMP}/menuitems)\n${fcount} Exit") \
                                                2> ${TMP}/input || die "User termination!" 0
                                        my_input=$(<${TMP}/input)
                                fi
@@ -307,10 +307,10 @@ function do_merge() {
 
        until (( ${my_input} == -1 )); do
                echo "Merging ${file} and ${ofile}"
-               `echo "${merge_command}" |
+               $(echo "${merge_command}" |
                 sed -e "s:%merged:${mfile}:g" \
                         -e "s:%orig:${ofile}:g" \
-                        -e "s:%new:${file}:g"`
+                        -e "s:%new:${file}:g")
                until (( ${my_input} == -1 )); do       
                        echo -n "1) Replace ${ofile} with merged file
 2) Show differences between merged file and original
@@ -327,9 +327,9 @@ Please select from the menu above (-1 to exit, losing this merge): "
                                   return 255
                                   ;;
                                2) ( echo "Showing differences between ${ofile} and ${mfile}"
-                                        `echo "${diff_command}" | \
+                                        $(echo "${diff_command}" | \
                                          sed -e "s:%file1:${ofile}:" \
-                                                 -e "s:%file2:${mfile}:"` ) | ${pager}
+                                                 -e "s:%file2:${mfile}:") ) | ${pager}
                                   continue
                                   ;;
                                3) break
@@ -375,15 +375,15 @@ CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)
 CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
 
 # load etc-config's configuration
-EU_AUTOMERGE=`get_config eu_automerge`
-rm_opts=`get_config rm_opts`
-mv_opts=`get_config mv_opts`
-cp_opts=`get_config cp_opts`
-pager=`get_config pager`
-diff_command=`get_config diff_command`
-using_editor=`get_config using_editor`
-merge_command=`get_config merge_command`
-declare -i mode=`get_config mode`
+EU_AUTOMERGE=$(get_config eu_automerge)
+rm_opts=$(get_config rm_opts)
+mv_opts=$(get_config mv_opts)
+cp_opts=$(get_config cp_opts)
+pager=$(get_config pager)
+diff_command=$(get_config diff_command)
+using_editor=$(get_config using_editor)
+merge_command=$(get_config merge_command)
+declare -i mode=$(get_config mode)
 [ -z ${mode} ] && mode=0
 [ -z "${pager}" ] && pager="cat"
 
index efd356e2edff7ca5048bba52560f5c38d337e282..82959b748ac7d2170e8144ca24b5eaa2b6c41dfa 100755 (executable)
@@ -8,10 +8,10 @@
 
 ulimit -c 0
 
-filelist=`sed "s/['\"]/\\\&/g"`
-exelist=`echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 `
-scriptlist=`echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 `
-liblist=`echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 `
+filelist=$(sed "s/['\"]/\\\&/g")
+exelist=$(echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 )
+scriptlist=$(echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 )
+liblist=$(echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 )
 
 for f in $exelist; do
     if [ -x $f ]; then
index c257a10d50c478e18b79bf1b8e40dea532b6d384..3a004a15f6cd704150d554df5091ee11930f7ef8 100644 (file)
@@ -187,7 +187,7 @@ unset_colors() {
 
 set_colors() {
        COLS=${COLUMNS:-0}      # bash's internal COLUMNS variable
-       (( COLS == 0 )) && COLS=$(set -- `stty size 2>/dev/null` ; echo $2)
+       (( COLS == 0 )) && COLS=$(set -- $(stty size 2>/dev/null) ; echo $2)
        (( COLS > 0 )) || (( COLS = 80 ))
        COLS=$((${COLS} - 8))   # width of [ ok ] == 7
 
index 90306d5658fa58e21f56a45bed24b37697d4be20..67d6bdcc4e582acc6058a097cf167b36adb70e6d 100644 (file)
@@ -298,7 +298,7 @@ preinst_suid_scan() {
                echo ">>> Preforming suid scan in ${IMAGE}"
                for i in $(find ${IMAGE}/ -type f \( -perm -4000 -o -perm -2000 \) ); do
                        if [ -s "${sfconf}" ]; then
-                               suid="`grep ^${i/${IMAGE}/}$ ${sfconf}`"
+                               suid="$(grep ^${i/${IMAGE}/}$ ${sfconf})"
                                if [ "${suid}" = "${i/${IMAGE}/}" ]; then
                                        echo "- ${i/${IMAGE}/} is an approved suid file"
                                else
@@ -312,7 +312,7 @@ preinst_suid_scan() {
                                                # can easly be bypassed using the addwrite() function
                                                addwrite "${sfconf}"
                                                echo ">>> Appending commented out entry to ${sfconf} for ${PF}"
-                                               ls_ret=`ls -ldh "${i}"`
+                                               ls_ret=$(ls -ldh "${i}")
                                                echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf}
                                                echo "#${i/${IMAGE}/}" >> ${sfconf}
                                                # no delwrite() eh?
index be293003f92fef09510f88022ada6da4bd9b7470..16bd4901a49aa9921f3c7ecdfeec051d897959d2 100755 (executable)
@@ -3,13 +3,13 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.6 2004/10/04 13:56:50 vapier Exp $
 
-z="`find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null`"
+z="$(find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null)"
 
 for y in ${z} ; do
        if [ -L "${y}" ] ; then
                # Symlink ...
                mylink="${y}"
-               linkto="`readlink "${y}"`"
+               linkto="$(readlink "${y}")"
 
                if [ "${linkto##*.}" != "gz" ] ; then
                        linkto="${linkto}.gz"
index 4b21930bd50dc6c9ccdfba570996c82126fefde0..e2422e7605bdaab630791388af7961ef98939bf4 100755 (executable)
@@ -17,11 +17,11 @@ fi
 
 rm -f "${z}"/{dir,dir.info,dir.info.gz}
 
-for x in `find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null` ; do
+for x in $(find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null) ; do
        if [ -L "${x}" ] ; then
                # Symlink ...
                mylink="${x}"
-               linkto="`readlink "${x}"`"
+               linkto="$(readlink "${x}")"
 
                if [ "${linkto##*.}" != "gz" ] ; then
                        linkto="${linkto}.gz"
index abb3d294178b7eed3dfcf8d888d6fc328be87c97..61b09a609afb5e1dc9055c5a7a7a6304e59b591c 100755 (executable)
@@ -9,7 +9,7 @@
 # Resulting tbz2 file will be created in ${PKGDIR} ...
 # default is /usr/portage/packages/All/
 
-if [ "`whoami`" != "root" ] ; then
+if [ "${UID}" != "0" ] ; then
        echo "You must run this as root"
        exit 1
 fi