From 8b4aff233b3f6542a3c36b2c957987d56ebadaf0 Mon Sep 17 00:00:00 2001 From: "y0169.zhang" Date: Tue, 12 Sep 2017 11:18:50 +0800 Subject: [PATCH] Fix spec name error with incremental case Change-Id: I06853dca9371053bdd35fe0816ecbefa40f57444 Signed-off-by: Jun Wang --- depanneur | 59 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/depanneur b/depanneur index fec59af..e00be54 100755 --- a/depanneur +++ b/depanneur @@ -649,11 +649,13 @@ sub fill_packs_from_git { next if $arg_spec ne "" && $_ ne $arg_spec; $specs = $specs . "$base/$l_packaging_dir/$_" . ","; } - push(@pre_packs, {filename => "$specs", - project_base_path => $base, - packaging_dir => $l_packaging_dir, - upstream_branch => $l_upstream_branch, - upstream_tag => $l_upstream_tag}); + if ($specs ne "") { + push(@pre_packs, {filename => "$specs", + project_base_path => $base, + packaging_dir => $l_packaging_dir, + upstream_branch => $l_upstream_branch, + upstream_tag => $l_upstream_tag}); + } } else { #packaging_dir is a symbol link my (undef, $tmp_symlink_file) = tempfile(OPEN => 0); @@ -667,11 +669,13 @@ sub fill_packs_from_git { next if $arg_spec ne "" && $_ ne $arg_spec; $specs = $specs . "$base/$first_line/$_" . ","; } - push(@pre_packs, {filename => "$specs", - project_base_path => $base, - packaging_dir => $l_packaging_dir, - upstream_branch => $l_upstream_branch, - upstream_tag => $l_upstream_tag}); + if ($specs ne "") { + push(@pre_packs, {filename => "$specs", + project_base_path => $base, + packaging_dir => $l_packaging_dir, + upstream_branch => $l_upstream_branch, + upstream_tag => $l_upstream_tag}); + } close($symlink_file); unlink $tmp_symlink_file; } @@ -688,11 +692,13 @@ sub fill_packs_from_git { foreach my $spec (@spec_list) { $specs = $specs . $spec . ","; } - push(@pre_packs, {filename => "$specs", - project_base_path => $base, - packaging_dir => $l_packaging_dir, - upstream_branch => $l_upstream_branch, - upstream_tag => $l_upstream_tag}); + if ($specs ne "") { + push(@pre_packs, {filename => "$specs", + project_base_path => $base, + packaging_dir => $l_packaging_dir, + upstream_branch => $l_upstream_branch, + upstream_tag => $l_upstream_tag}); + } } } @@ -2350,9 +2356,14 @@ $gbs_version =~ s!gbs !!; if ($style eq 'git') { File::Find::find({wanted => \&git_wanted}, $package_path ); - if (@pre_packs > 1 && $commit ne "HEAD"){ - error("--commit option can't be specified with multiple packages"); + foreach my $p (@pre_packs) { + my $specs = $p->{"filename"}; + my @spec_list = split(",", $specs); + if (@spec_list > 1 && $commit ne "HEAD"){ + error("--commit option can't be specified with multiple packages"); + } } + if (@pre_packs == 0) { error("No source package found at $package_path"); } @@ -2410,7 +2421,19 @@ if ($style eq 'git') { } } } else { - @packs = @pre_packs; + foreach my $p (@pre_packs) { + my $specs = $p->{"filename"}; + my $new_p; + $new_p->{"project_base_path"} = $p->{"project_base_path"}; + $new_p->{"packaging_dir"} = $p->{"packaging_dir"}; + $new_p->{"upstream_branch"} = $p->{"upstream_branch"}; + $new_p->{"upstream_tag"} = $p->{"upstream_tag"}; + my @spec_list = split(",", $specs); + foreach my $spec (@spec_list) { + $new_p->{"filename"} = $spec; + push @packs, $new_p; + } + } } } else { @packs = @ARGV; -- 2.7.4