Pass the export directory to gbs export which could
authory0169.zhang <y0169.zhang@samsung.com>
Wed, 6 Dec 2017 11:31:51 +0000 (19:31 +0800)
committery0169.zhang <y0169.zhang@samsung.com>
Wed, 6 Dec 2017 11:31:54 +0000 (19:31 +0800)
get the correct macros used in spec

Change-Id: I5c7bdc7c82228e4beeb8216b3a13fa214b442809

depanneur

index 7a1923e..df6037b 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -711,14 +711,15 @@ sub fill_packs_from_git {
 # Call gbs export
 #---------------------------------------------------------------------
 sub gbs_export {
-    my ($base, $spec, $packaging_dir, $upstream_branch, $upstream_tag) = @_;
+    my ($base, $spec, $packaging_dir, $upstream_branch, $upstream_tag, $out_dir) = @_;
     my @args = ();
     my $cmd;
     push @args, "gbs";
     push @args, "--debug" if ($debug);
     push @args, "export";
     push @args, "$base";
-    push @args, "-o $pkg_path";
+    push @args, "-o $out_dir";
+    push @args, "--outdir-directly";
     push @args, "--spec $spec";
     if ($includeall == 1) {
         push @args, "--include-all";
@@ -783,8 +784,9 @@ sub write_cache {
     my ($cache_key, $cache_val, $base, $spec, $packaging_dir, $upstream_branch, $upstream_tag) = @_;
     my $cache_fname = "$cache_path/$cache_key";
     my @export_out;
+    my $out_dir = "$pkg_path/$cache_key";
 
-    @export_out = gbs_export($base, $spec, $packaging_dir, $upstream_branch, $upstream_tag);
+    @export_out = gbs_export($base, $spec, $packaging_dir, $upstream_branch, $upstream_tag, $out_dir);
     if (shift @export_out) {
         # if export failed, collect export error to report
         push(@export_errors, {package_name => $cache_key,