From ca893460ccb094781f17ec20d129d6d71a4d4caa Mon Sep 17 00:00:00 2001 From: "biao716.wang" Date: Fri, 24 Jun 2022 21:03:16 +0900 Subject: [PATCH] fix gbs build error: https://github.sec.samsung.net/RS-tizen-build/issues/issues/913 THis issue is caused that some variables are not re-intialized after used in while loop. refer to .srcfiles.cache file, linux-kernel-perf info is just before linux-tizen-modules-headers, and linux-tizen-modules-headers has no require info, it will use the last cache in $pkgR. Change-Id: I874eca19e99d707b2971c618dd3e37c0bfefeeba Signed-off-by: biao716.wang --- expanddeps | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/expanddeps b/expanddeps index 5a8af47..511a3c5 100755 --- a/expanddeps +++ b/expanddeps @@ -122,7 +122,7 @@ if ($recipe && $recipe =~ /(^|\/)PKGBUILD$/) { # read dist if we can my $cf; if (defined($dist) && $dist ne '') { - $cf = Build::read_config_dist($dist, $archs[0], $configdir); + $cf = Build::read_config_dist($dist, $archs[0] || 'noarch', $configdir); $binarytype = $cf->{'binarytype'} if $cf->{'binarytype'} && $cf->{'binarytype'} ne 'UNDEFINED'; } @@ -162,7 +162,7 @@ if (!defined($dist) || $dist eq '') { print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n"; } -$cf = Build::read_config_dist($dist, $archs[0], $configdir); +$cf ||= Build::read_config_dist($dist, $archs[0] || 'noarch', $configdir); $cf->{'warnings'} = 1; my $dofileprovides = %{$cf->{'fileprovides'}}; @@ -205,20 +205,20 @@ while() { } } elsif (/^P:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgP = $2; - next if $prov{$1}; - $prov{$1} = $2 + next if $prov{$1}; + $prov{$1} = $2; } elsif (/^R:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgR = $2; - next if $req{$1}; - $req{$1} = $2; + next if $req{$1}; + $req{$1} = $2; } elsif (/^C:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgC = $2; - next if $con{$1}; - $con{$1} = $2; + next if $con{$1}; + $con{$1} = $2; } elsif (/^O:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgO = $2; - next if $obs{$1}; - $obs{$1} = $2; + next if $obs{$1}; + $obs{$1} = $2; } elsif (/^r:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgr = $2; } elsif (/^s:(.*?)-\d+\/\d+\/\d+: (.*)$/) { @@ -257,24 +257,32 @@ while() { delete $rec{$i}; delete $con{$i}; delete $obs{$i}; - delete $rec{$i}; - delete $sup{$i}; + delete $rec{$i}; + delete $sup{$i}; $req{$i} = $pkgR if defined $pkgR; $con{$i} = $pkgC if defined $pkgC; $obs{$i} = $pkgO if defined $pkgO; - $rec{$i} = $pkgr if defined $pkgr; - $sup{$i} = $pkgs if defined $pkgs; + $rec{$i} = $pkgr if defined $pkgr; + $sup{$i} = $pkgs if defined $pkgs; } else { - next if $ids{$1}; - $ids{$1} = $2; + #also need to clean the below values. + undef $pkgF; + undef $pkgP; + undef $pkgR; + undef $pkgC; + undef $pkgO; + undef $pkgr; + undef $pkgs; + next if $ids{$1}; + $ids{$1} = $2; } undef $pkgF; undef $pkgP; undef $pkgR; undef $pkgC; undef $pkgO; - undef $pkgr; - undef $pkgs; + undef $pkgr; + undef $pkgs; } elsif ($_ eq 'D:') { %packs_done = %ids; } -- 2.34.1