Modify function_test error
authorshuai.fu <shuai01.fu@samsung.com>
Mon, 24 Apr 2017 10:10:05 +0000 (18:10 +0800)
committershuai.fu <shuai01.fu@samsung.com>
Thu, 4 May 2017 08:42:50 +0000 (16:42 +0800)
Change-Id: I89dee30c6e0fc3123e181f3c4e5d156a9fcaa644
Signed-off-by: shuai.fu <shuai01.fu@samsung.com>
Build.pm
build
build-recipe-spec
expanddeps
init_buildsystem
qemu-reg

index d1c39d7..b3ef398 100644 (file)
--- a/Build.pm
+++ b/Build.pm
@@ -1019,7 +1019,8 @@ sub expand {
     @q = nevrmatch($config, $r, @q) if /^!!/;
     $aconflicts{$_} = "is in BuildConflicts" for @q;
   }
-
+   my %recommended;
+   my @rec_todo;
   @p = grep {!/^[-!]/} @p;
   my %p;               # expanded packages
 
diff --git a/build b/build
index b154838..ea0f113 100755 (executable)
--- a/build
+++ b/build
@@ -524,11 +524,11 @@ setmemorylimit() {
        case "$mem" in
            MemTotal:*)
                set -- $mem
-               eval "limit=\$(($2/3*2))"
+               eval "limit=\$(($2/3*4))"
            ;;
            SwapTotal:*)
                set -- $mem
-               eval "limit=\$(($2/3*2+$limit))"
+               eval "limit=\$(($2/3*4+$limit))"
            ;;
        esac
     done < <(cat /proc/meminfo) # cat for proc stuff
@@ -812,8 +812,8 @@ while test -n "$1"; do
       -baselibs-internal)
        CREATE_BASELIBS=internal
        ;;
-       --keep-packs)
-        KEEP_PACKS="--keep-packs"
+      -keep-packs)
+    KEEP_PACKS="--keep-packs"
        ;;
       -root)
        needarg
index c42c71a..735b57e 100644 (file)
@@ -27,10 +27,13 @@ recipe_setup_spec() {
        echo "Error: TOPDIR empty"
        cleanup_and_exit 1
     fi
-    test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
-    for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do
-       mkdir -p $BUILD_ROOT$TOPDIR/$i
-    done
+    if [ "$NO_TOPDIR_CLEANUP" = false ]; then
+           rm -rf "$BUILD_ROOT$TOPDIR"
+           for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do
+               mkdir -p $BUILD_ROOT$TOPDIR/$i
+            done
+    fi
+
     chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
     mkdir -p $BUILD_ROOT$TOPDIR/SOURCES
     cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
@@ -56,7 +59,9 @@ recipe_prepare_spec() {
        mv $BUILD_ROOT/usr/lib/rpm/rpmrc $BUILD_ROOT/usr/lib/rpm/rpmrc_i586
        sed -e 's/^buildarchtranslate: athlon.*/buildarchtranslate: athlon: i686/' -e 's/^buildarchtranslate: i686.*/buildarchtranslate: i686: i686/' < $BUILD_ROOT/usr/lib/rpm/rpmrc_i586 > $BUILD_ROOT/usr/lib/rpm/rpmrc
     fi
-
+    if test "$DO_BUILD" = false ; then
+        cleanup_and_exit 0
+    fi
     # extract macros from configuration
     queryconfig rawmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/$rawcfgmacros
     if test -n "$BUILD_DEBUG" && test "$BUILDTYPE" != debbuild ; then
@@ -112,7 +117,7 @@ recipe_build_spec() {
     test "$BUILDTYPE" = debbuild && rpmbuild=debbuild
 
     # XXX: move _srcdefattr to macro file?
-    rpmbopts=("$BUILD_RPM_BUILD_STAGE" "--define" "_srcdefattr (-,root,root)")
+    rpmbopts=("--define" "_srcdefattr (-,root,root)")
     if test "$DO_CHECKS" != true ; then
        if chroot "$BUILD_ROOT" "$rpmbuild" --nocheck --help >/dev/null 2>&1; then
            rpmbopts[${#rpmbopts[@]}]="--nocheck"
@@ -142,11 +147,31 @@ recipe_build_spec() {
 
     # su involves a shell which would require even more
     # complicated quoting to bypass than this
-    toshellscript $rpmbuild \
-           "${definesnstuff[@]}" \
-           "${rpmbopts[@]}" \
-           "$TOPDIR/SOURCES/$RECIPEFILE" \
-           > $BUILD_ROOT/.build.command
+       if test "$SHORT_CIRCUIT" = false ; then
+           rpmbopts[${#rpmbopts[@]}]="$BUILD_RPM_BUILD_STAGE"
+           toshellscript $rpmbuild \
+                   "${definesnstuff[@]}" \
+                   "${rpmbopts[@]}" \
+                   "$TOPDIR/SOURCES/$RECIPEFILE" \
+                   > $BUILD_ROOT/.build.command
+       else
+           rpmbopts[${#rpmbopts[@]}]='--short-circuit'
+           buildopts="-bc -bi -bb -bs"
+           cmds=""
+           echo "#!/bin/sh -x" >$BUILD_ROOT/.build.command
+           echo "set -e" >>$BUILD_ROOT/.build.command
+           for opt in $buildopts
+           do
+               shellquote $rpmbuild  \
+                       "${definesnstuff[@]}" \
+                       "${rpmbopts[@]}" $opt \
+                       "$TOPDIR/SOURCES/$RECIPEFILE" \
+                       >> $BUILD_ROOT/.build.command
+               echo >>$BUILD_ROOT/.build.command
+               [ "$opt" == "$BUILD_RPM_BUILD_STAGE" ] && break
+           done
+       fi
+       
     chmod 755 $BUILD_ROOT/.build.command
     check_exit
     if test -n "$RUN_SHELL"; then
index d233844..dcd0eba 100755 (executable)
@@ -162,7 +162,7 @@ if (!defined($dist) || $dist eq '') {
   print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n";
 }
 
-my $cf = Build::read_config_dist($dist, $archs[0], $configdir);
+$cf = Build::read_config_dist($dist, $archs[0], $configdir);
 $cf->{'warnings'} = 1;
 
 my $dofileprovides = %{$cf->{'fileprovides'}};
@@ -427,7 +427,7 @@ if ($useusedforbuild) {
 }
 
 #######################################################################
-
+my @packdeps;
 my $subpacks = [];
 
 my $buildtype = '';
index 9ccfade..27492f7 100755 (executable)
@@ -46,6 +46,12 @@ repos=()
 
 . $BUILD_DIR/common_functions || exit 1
 
+BUILD_IS_RUNNING=$BUILD_ROOT/not-ready
+TMPFILE=$BUILD_ROOT/tmpfile
+RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDTIME}-%{ARCH}\n"
+RPMCHECKOPTS_HOST=
+test -x /usr/bin/rpmquery && RPMCHECKOPTS_HOST="--nodigest --nosignature"
+
 # should RPMs be installed with --force ?
 USE_FORCE=false
 PREPARE_VM=
@@ -958,7 +964,7 @@ if [ -z "$KEEP_PACKS" ]; then
         PKG=${PKG##*/}
         test "$PKG" = "*" && continue
         echo "deleting $PKG"
-        rpm_e "$PKG"
+               pkg_erase
         check_exit
     done
     rm -rf "$BUILD_ROOT/.init_b_cache/todelete"
index a555394..c8495c0 100644 (file)
--- a/qemu-reg
+++ b/qemu-reg
@@ -11,7 +11,7 @@
 
 :alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P alpha
 
-:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:P armv6l armv7l armv8l
+:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:
 :armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P armv6b armv7b armv8b
 
 :ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P ppc ppc64