From 41983c59d1697ee299aeef16aa360b53f7ec4dd2 Mon Sep 17 00:00:00 2001 From: "jingui.ren" Date: Mon, 29 Oct 2018 16:52:30 +0800 Subject: [PATCH] adjust circle check method Change-Id: I664f4fbf1d20f2e629db60e22130fadb3823c236 --- depanneur | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/depanneur b/depanneur index 2b08728..80e5c56 100755 --- a/depanneur +++ b/depanneur @@ -1404,7 +1404,9 @@ sub get_top_order { my @queue = (); my @top_order = (); my %ref_build_complete = (); + my $pkg_number = 0; for my $pack (sort keys %pkgddeps) { + $pkg_number++; $ref_build_complete{$pack} = 0; my $pack_in_degree = 0; if (defined $pkgddeps{$pack}) { @@ -1425,7 +1427,14 @@ sub get_top_order { } } } - return @top_order; + if($pkg_number == @top_order) { + info("there is no circle in $pkg_number packages"); + return @top_order; + } + else { + info("circle found in $pkg_number packages, exit..."); + exit 1; + } } #--------------------------------------------------------------------- @@ -1507,10 +1516,10 @@ sub update_pkgddeps { } } - if (check_circle() == 1) { - info("circle found, exit..."); - exit 1; - } + #if (check_circle() == 1) { + # info("circle found, exit..."); + # exit 1; + #} # Expand dependency using direct dependency dict # pkgddeps => pkgdeps @@ -2771,10 +2780,10 @@ if ($noinit == 1 || $incremental == 1) { } -if (check_circle() == 1) { - info("circle found, exit..."); - exit 1; -} +#if (check_circle() == 1) { +# info("circle found, exit..."); +# exit 1; +#} if ($debug) { my $pkg; -- 2.34.1