From 3472b40ba5a0cd59d496949fb2ef8d0c0d4771e0 Mon Sep 17 00:00:00 2001 From: "yan11.meng" Date: Sun, 26 Apr 2020 15:23:56 +0800 Subject: [PATCH] fix gbs build error about path with'[]' Change-Id: I25fbe60466a632f5feb4e2375284584e4d518501 Signed-off-by: yan11.meng --- depanneur | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/depanneur b/depanneur index b83b5f6..16a406c 100755 --- a/depanneur +++ b/depanneur @@ -619,6 +619,24 @@ sub fill_packs_from_obs { # - get the real packaging dir if it's a symbol link # - collect all spec files to @pre_packs #--------------------------------------------------------------------- +my @spec_lists; +sub spec_wanted{ + if($arg_spec ne ""){ + if(-f $File::Find::name){ + if($File::Find::name =~ /$arg_spec/){ + push(@spec_lists,$File::Find::name); + } + } + } + else + { + if(-f $File::Find::name){ + if($File::Find::name =~ /\.spec$/){ + push(@spec_lists,$File::Find::name); + } + } + } +} sub fill_packs_from_git { my $name = shift; my $base = dirname($name); @@ -702,11 +720,13 @@ sub fill_packs_from_git { } } else { # specify --include-all use current packaging dir not from git - my $pattern = "$base/$l_packaging_dir/*.spec"; - $pattern = "$base/$l_packaging_dir/$arg_spec" if $arg_spec ne ""; - my @spec_list = glob($pattern); + #my $pattern = "$base/$l_packaging_dir/*.spec"; + #$pattern = "$base/$l_packaging_dir/$arg_spec" if $arg_spec ne ""; + #my @spec_list = glob($pattern); + my $f_path="$base/$l_packaging_dir"; + File::Find::find({wanted => \&spec_wanted},$f_path); my $specs = ""; - foreach my $spec (@spec_list) { + foreach my $spec (@spec_lists) { $specs = $specs . $spec . ","; } if ($specs ne "") { -- 2.34.1