Set ENV variable in main thread.
authorHuang Hao <hao.h.huang@intel.com>
Thu, 27 Sep 2012 04:14:28 +0000 (12:14 +0800)
committerHuang Hao <hao.h.huang@intel.com>
Thu, 27 Sep 2012 04:14:28 +0000 (12:14 +0800)
Change-Id: If968325d996cd991db01887073d4d20af90450e2

depanneur

index 7be3f39aac772fb81d5ae739fcb01e33e5897c9d..1ec04300c0e4d1d1990dd579140c5e350c253b80 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -83,6 +83,7 @@ my $order_dir = "$build_root/local/order";
 my $cache_dir = "$build_root/local/cache";
 my $groupfile="$build_root/meta/group.xml";
 my $build_dir = "$virtualenv/usr/lib/build";
+$ENV{'BUILD_DIR'} = $build_dir; # must change env variable in main thread
 my $config_filename = "$build_root/meta/local.yaml";
 my $dist_configs = "$build_root/meta/dist";
 my $exclude_from_file = "$build_root/meta/exclude";
@@ -765,8 +766,6 @@ sub build_package {
     # Rebuild the package.
     info("*** building $name-$version-$release $arch $dist (worker: $thread) ***");
 
-    $ENV{'BUILD_DIR'} = $build_dir;
-
     if ( -d "$localrepo/$dist/$arch/RPMS" ) {
         push @args, "--repository $localrepo/$dist/$arch/RPMS";
     }