Enable kvm build function
authorJiankang Fan <jiankang.fan@samsung.com>
Tue, 27 Sep 2016 03:15:21 +0000 (11:15 +0800)
committerSoonKyu Park <sk7.park@samsung.com>
Thu, 29 Dec 2016 09:22:33 +0000 (18:22 +0900)
Change-Id: Ie3a8adf5c2203947eb4646cfc11a34f7fbf4659f

expanddeps
init_buildsystem

index 0f55cb675837674e074ae53825b914ce4c825e2a..3a8d561c0aa0e67e346a4bede75ba0e555502f2d 100755 (executable)
@@ -9,7 +9,7 @@ use strict;
 use Build;
 use File::Basename;
 
-my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $usehigherdeps);
+my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $usehigherdeps, $isvm);
 
 while (@ARGV)  {
   if ($ARGV[0] eq '--dist') {
@@ -60,6 +60,11 @@ while (@ARGV)  {
     $usehigherdeps = 1;
     next;
   }
+  if ($ARGV[0] eq '--vm') {
+    shift @ARGV;
+    $isvm = 1;
+    next;
+  }
   last;
 }
 $configdir = '.' unless defined $configdir;
@@ -304,6 +309,9 @@ Build::readdeps($cf, undef, \%repo);
 
 #######################################################################
 
+if ($isvm) {
+  push @packdeps, @{$cf->{'vminstall'}};
+}
 my @bdeps = Build::get_build($cf, $subpacks, @packdeps, @extradeps);
 
 if (!shift @bdeps) {
@@ -315,5 +323,8 @@ if (!shift @bdeps) {
 # make sure all preinstalls are in bdeps;
 # XXX: also add vmdeps?
 @bdeps = Build::unify(@bdeps, Build::get_preinstalls($cf));
+if ($isvm) {
+  @bdeps = Build::unify(@bdeps, Build::get_vminstalls($cf));
+}
 
 print_rpmlist(@bdeps);
index a36e99378ae3bb9c1c0ef20fef3d6516c83a62af..4dbd3c2fad78384a4e331003e076a028c420d22c 100755 (executable)
@@ -675,7 +675,9 @@ else
        #
        RPMLIST=$BUILD_ROOT/.init_b_cache/rpmlist
        test -z "$LIST_STATE" && echo "expanding package dependencies..."
-       if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $USEHIGHERDEPS "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
+        VMOPT=
+        test -z "$PREPARE_VM" || VMOPT=--vm
+       if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $VMOPT $USEHIGHERDEPS "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
            rm -f $BUILD_IS_RUNNING
            cleanup_and_exit 1
        fi