fix BUILD_ROOT variable read error
authorjingui.ren <jingui.ren@samsung.com>
Tue, 12 Jun 2018 11:51:01 +0000 (19:51 +0800)
committerjingui.ren <jingui.ren@samsung.com>
Tue, 12 Jun 2018 11:55:12 +0000 (19:55 +0800)
Change-Id: Icf7eab6730a5523d98e0eee20dc466191f92a271

build
build-pkg-arch
build-pkg-deb

diff --git a/build b/build
index c02e12b..fd11b70 100755 (executable)
--- a/build
+++ b/build
@@ -441,7 +441,7 @@ setupccache() {
                echo 'export PATH=/usr/lib/icecc/bin:/opt/icecream/bin:/usr/bin:$PATH' >> "$BUILD_ROOT"/var/lib/build/ccache/bin/$i
                echo "ccache $i \"\$@\"" >> "$BUILD_ROOT"/var/lib/build/ccache/bin/$i
                chmod 755 "$BUILD_ROOT"/var/lib/build/ccache/bin/$i
-               echo "Installed ccache wrapper as '$BUILD_ROOT'/var/lib/build/ccache/bin/$i"
+               echo "Installed ccache wrapper as $BUILD_ROOT/var/lib/build/ccache/bin/$i"
            done
        fi
        mkdir -p "$BUILD_ROOT/.ccache"
index be5dac5..3328700 100644 (file)
@@ -68,7 +68,7 @@ pkg_preinstall_arch() {
 }
 
 pkg_runscripts_arch() {
-    if test -e "'$BUILD_ROOT'/.init_b_cache/scripts/$PKG.post" ; then
+    if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
        echo "running $PKG postinstall script"
        ( cd "$BUILD_ROOT" && chroot "$BUILD_ROOT" ".init_b_cache/scripts/$PKG.post" < /dev/null )
        rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
index 2ee0f95..6f625b2 100644 (file)
@@ -41,24 +41,24 @@ deb_chroot ()
 }
 
 deb_setup() {
-    mkdir -p $"BUILD_ROOT"/var/lib/dpkg
-    mkdir -p $"BUILD_ROOT"/var/log
-    mkdir -p $"BUILD_ROOT"/etc/default
-    :>> $"BUILD_ROOT"/var/lib/dpkg/status
-    :>> $"BUILD_ROOT"/var/lib/dpkg/available
-    :>> $"BUILD_ROOT"/var/log/dpkg.log
-    :>> $"BUILD_ROOT"/etc/ld.so.conf
-    :>> $"BUILD_ROOT"/etc/default/rcS
+    mkdir -p "$BUILD_ROOT"/var/lib/dpkg
+    mkdir -p "$BUILD_ROOT"/var/log
+    mkdir -p "$BUILD_ROOT"/etc/default
+    :>> "$BUILD_ROOT"/var/lib/dpkg/status
+    :>> "$BUILD_ROOT"/var/lib/dpkg/available
+    :>> "$BUILD_ROOT"/var/log/dpkg.log
+    :>> "$BUILD_ROOT"/etc/ld.so.conf
+    :>> "$BUILD_ROOT"/etc/default/rcS
 }
 
 pkg_initdb_deb() {
     deb_setup
     # force dpkg into database to make epoch test work
-    if ! test "'$BUILD_ROOT'/.init_b_cache/rpms/dpkg.deb" -ef "'$BUILD_ROOT'/.init_b_cache/dpkg.deb" ; then
-       rm -f $"BUILD_ROOT"/.init_b_cache/dpkg.deb
-       cp $"BUILD_ROOT"/.init_b_cache/rpms/dpkg.deb $"BUILD_ROOT"/.init_b_cache/dpkg.deb || cleanup_and_exit 1
+    if ! test "$BUILD_ROOT/.init_b_cache/rpms/dpkg.deb" -ef "$BUILD_ROOT/.init_b_cache/dpkg.deb" ; then
+       rm -f "$BUILD_ROOT"/.init_b_cache/dpkg.deb
+       cp "$BUILD_ROOT"/.init_b_cache/rpms/dpkg.deb "$BUILD_ROOT"/.init_b_cache/dpkg.deb || cleanup_and_exit 1
     fi
-    deb_chroot $"BUILD_ROOT" dpkg --install --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1
+    deb_chroot "$BUILD_ROOT" dpkg --install --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1
 }
 
 pkg_prepare_deb() {
@@ -66,7 +66,7 @@ pkg_prepare_deb() {
 }
 
 pkg_install_deb() {
-    ( deb_chroot $"BUILD_ROOT" dpkg --install --force-depends .init_b_cache/$PKG.deb 2>&1 || touch $"BUILD_ROOT"/exit ) | \
+    ( deb_chroot "$BUILD_ROOT" dpkg --install --force-depends .init_b_cache/$PKG.deb 2>&1 || touch "$BUILD_ROOT"/exit ) | \
        perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg|Preparing to unpack )/||/^$/||print'
     # ugly workaround for upstart system. some packages (procps) try
     # to start a service in their configure phase. As we don't have