]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes: Replace "if test" file tests with POSIX file tests uninative-1.6
authorRobert P. J. Day <rpjday@crashcourse.ca>
Sat, 25 Mar 2017 18:03:55 +0000 (14:03 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Mar 2017 10:08:28 +0000 (11:08 +0100)
In entire meta/classes/ directory, replace shell tests of the form
"if test -? ..." with POSIX tests of the form "if [ -? ...

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/distutils-tools.bbclass
meta/classes/distutils.bbclass
meta/classes/distutils3.bbclass
meta/classes/go.bbclass
meta/classes/gtk-doc.bbclass
meta/classes/kernel-fitimage.bbclass
meta/classes/kernel-uboot.bbclass
meta/classes/kernel-uimage.bbclass
meta/classes/populate_sdk_base.bbclass

index 3ef9cc5a787893bf89719d9b0fd3d8c71f0922d6..6f2880ea0154b6b972a99cedf92ffe5e13b5831e 100644 (file)
@@ -63,7 +63,7 @@ distutils_do_install() {
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
         fi
 }
index 857572d759801270028a639aeac2b79ea9b3f704..e5abdd1216615ac666b26b65a99a77b74d0e4da4 100644 (file)
@@ -50,7 +50,7 @@ distutils_do_install() {
             done
         fi
 
-        if test -e ${D}${sbindir}; then
+        if [ -e ${D}${sbindir} ]; then
             for i in ${D}${sbindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
                        sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
@@ -65,13 +65,13 @@ distutils_do_install() {
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
             rmdir ${D}${datadir}/share
         fi
 
        # Fix backport modules
-       if test -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py && test -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py; then
+       if [ -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py ] && [ -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py ]; then
           rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
           rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
        fi
index a6720c5b6be2b9e8e043563c04afe5f1b5898f04..01ef72a987eb7301be6b50649445eb9bf1a2c84d 100644 (file)
@@ -64,7 +64,7 @@ distutils3_do_install() {
         #
         # FIXME: Bandaid against wrong datadir computation
         #
-        if test -e ${D}${datadir}/share; then
+        if [ -e ${D}${datadir}/share ]; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
             rmdir ${D}${datadir}/share
         fi
index 42bbd73cf884f864091b2002b88362b7187f1565..85f71a2e9a6e5a860c6adb30eb75ff1012ea8ce2 100644 (file)
@@ -36,7 +36,7 @@ GO_INSTALL ?= "${GO_IMPORT}/..."
 
 do_go_compile() {
        GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
-       if test -n "${GO_INSTALL}" ; then
+       if [ -n "${GO_INSTALL}" ]; then
                GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL}
        fi
 }
@@ -61,7 +61,7 @@ do_go_install() {
 
        chown -R root:root "${D}${GOROOT_FINAL}"
 
-       if test -e "${D}${GOBIN_FINAL}" ; then
+       if [ -e "${D}${GOBIN_FINAL}" ]; then
                install -d -m 0755 "${D}${bindir}"
                find "${D}${GOBIN_FINAL}" ! -type d -print0 | xargs -r0 mv --target-directory="${D}${bindir}"
                rmdir -p "${D}${GOBIN_FINAL}" || true
index 297eac63b7b8b8d7f5ae000ab83038b3ffde215f..0ae2729c0a001708114dd2d4b4ffa6bf0970fe47 100644 (file)
@@ -50,7 +50,7 @@ export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
 
 GIR_EXTRA_LIBS_PATH=\`find ${B} -name .libs| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
 
-if test -d ".libs"; then
+if [ -d ".libs" ]; then
     $qemu_binary ".libs/\$@"
 else
     $qemu_binary "\$@"
index 2d344b52cd9d695081d3cd014e9d83bfed39dbb3..8ae2eb6df570de004c19a6283ca2b8486a193a69 100644 (file)
@@ -96,7 +96,7 @@ fitimage_emit_section_kernel() {
        kernel_csum="sha1"
 
        ENTRYPOINT=${UBOOT_ENTRYPOINT}
-       if test -n "${UBOOT_ENTRYSYMBOL}"; then
+       if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
                ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
                        awk '$4=="${UBOOT_ENTRYSYMBOL}" {print $2}'`
        fi
@@ -339,7 +339,7 @@ fitimage_assemble() {
        #
        # Step 2: Prepare a DTB image section
        #
-       if test -n "${KERNEL_DEVICETREE}"; then
+       if [ -n "${KERNEL_DEVICETREE}" ]; then
                dtbcount=1
                for DTB in ${KERNEL_DEVICETREE}; do
                        if echo ${DTB} | grep -q '/dts/'; then
@@ -359,7 +359,7 @@ fitimage_assemble() {
        #
        # Step 3: Prepare a setup section. (For x86)
        #
-       if test -e arch/${ARCH}/boot/setup.bin ; then
+       if [ -e arch/${ARCH}/boot/setup.bin ]; then
                setupcount=1
                fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
        fi
@@ -383,7 +383,7 @@ fitimage_assemble() {
 
        # Force the first Kernel and DTB in the default config
        kernelcount=1
-       if test -n "${dtbcount}"; then
+       if [ -n "${dtbcount}" ]; then
                dtbcount=1
        fi
 
@@ -392,7 +392,7 @@ fitimage_assemble() {
        #
        fitimage_emit_section_maint ${1} confstart
 
-       if test -n "${DTBS}"; then
+       if [ -n "${DTBS}" ]; then
                i=1
                for DTB in ${DTBS}; do
                        fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
index 345e7f5f3b4f881d6bddbb11fb056f3f97878be1..868e97d7a75af741397ae422c999fc4764d4ad8e 100644 (file)
@@ -1,5 +1,5 @@
 uboot_prep_kimage() {
-       if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+       if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
                vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
                linux_suffix=""
                linux_comp="none"
index 7e7185f903a75a80bddaf69454d24148a0b84f75..e2e9b631105b5093e1da1f867d5a5412ddf96019 100644 (file)
@@ -23,7 +23,7 @@ do_uboot_mkimage() {
                        uboot_prep_kimage
 
                        ENTRYPOINT=${UBOOT_ENTRYPOINT}
-                       if test -n "${UBOOT_ENTRYSYMBOL}"; then
+                       if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
                                ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
                                        awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
                        fi
index dd3cac5d69adc3df2cd98e63e4988fb9aa598ab5..563582e0a0e93fa6579d07676088887391fbb25f 100644 (file)
@@ -246,8 +246,7 @@ populate_sdk_log_check() {
 
                echo "log_check: Using $lf_path as logfile"
 
-               if test -e "$lf_path"
-               then
+               if [ -e "$lf_path" ]; then
                        ${IMAGE_PKGTYPE}_log_check $target $lf_path
                else
                        echo "Cannot find logfile [$lf_path]"