Fix https://bugs.tizen.org/browse/DEVT-345
authorfushuai <shuai01.fu@samsung.com>
Thu, 12 Oct 2017 09:43:34 +0000 (17:43 +0800)
committerfushuai <shuai01.fu@samsung.com>
Thu, 12 Oct 2017 09:43:34 +0000 (17:43 +0800)
Change-Id: Ie98f094039ed9cc776e5c8bd7b323e9662f7892b
Signed-off-by: fushuai <shuai01.fu@samsung.com>
Build/Rpm.pm
build-pkg-rpm
init_buildsystem

index 25a8e9c..d475184 100644 (file)
@@ -1084,7 +1084,7 @@ sub queryinstalled {
 
   $root = '' if !defined($root) || $root eq '/';
   local *F;
-  my $dochroot = $root ne '' && !$opts{'nochroot'} && !$< && (-x "$root/usr/bin/rpm" || -x "$root/bin/rpm") ? 1 : 0;
+  my $dochroot = $root ne '' && !$opts{'nochroot'} && !$< ? 1 : 0;
   my $pid = open(F, '-|');
   die("fork: $!\n") unless defined $pid;
   if (!$pid) {
index fc6a421..8b9f7a2 100644 (file)
@@ -109,16 +109,6 @@ pkg_cumulate_rpm() {
 }
 
 pkg_install_rpm() {
-    export ADDITIONAL_PARAMS=
-    if test "$USE_FORCE" = true ; then
-       export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force"
-    fi
-    # work around for cross-build installs, we must not overwrite the running rpm
-    if test "$PKG" = rpm ; then
-       for i in $BUILD_ROOT/.init_b_cache/preinstalls/rpm-x86-* ; do
-           test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
-       done
-    fi
     ( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
                $ADDITIONAL_PARAMS .init_b_cache/$PKG.rpm 2>&1 || \
          touch $BUILD_ROOT/exit ) | \
index 76b9e85..fdfa5ca 100755 (executable)
@@ -1060,6 +1060,17 @@ for PKG in $MAIN_LIST ; do
        check_exit
     fi
     
+    export ADDITIONAL_PARAMS=
+    if test "$USE_FORCE" = true ; then
+       export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force"
+    fi
+    # work around for cross-build installs, we must not overwrite the running rpm
+    if test "$PKG" = rpm ; then
+       for i in $BUILD_ROOT/.init_b_cache/preinstalls/rpm-x86-* ; do
+           test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
+       done
+    fi
+
     if pkg_cumulate ; then
        echo "cumulate ${PKGID%% *}"
        continue