From 621dcd8609a26ffe98fcb7fff05202bf5eb41112 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 7 Apr 2017 12:04:02 +0100 Subject: [PATCH 1/2] pakfire: Fix dependency resolver The old algorithm could potentially lock itself in an endless recursion when there were packages with circular dependencies. This version does not do this and is also faster. Reported-by: Arne Fitzenreiter Signed-off-by: Michael Tremer --- config/rootfiles/core/110/filelists/files | 1 + src/pakfire/lib/functions.pl | 47 ++++++++++++++--------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/config/rootfiles/core/110/filelists/files b/config/rootfiles/core/110/filelists/files index 4a7d710d7..f903fbd40 100644 --- a/config/rootfiles/core/110/filelists/files +++ b/config/rootfiles/core/110/filelists/files @@ -3,6 +3,7 @@ etc/issue etc/httpd/conf/server-tuning.conf etc/rc.d/init.d/unbound etc/sysctl.conf +opt/pakfire/lib/functions.pl srv/web/ipfire/cgi-bin/entropy.cgi srv/web/ipfire/cgi-bin/hardwaregraphs.cgi srv/web/ipfire/cgi-bin/index.cgi diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 11b1e37d5..c347916d8 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -541,7 +541,7 @@ sub dblist { } } -sub resolvedeps { +sub resolvedeps_one { my $pak = shift; getmetafile("$pak"); @@ -553,7 +553,7 @@ sub resolvedeps { close(FILE); my $line; - my (@templine, @deps, @tempdeps, @all); + my (@templine, @deps, @all); foreach $line (@file) { @templine = split(/\: /,$line); if ("$templine[0]" eq "Dependencies") { @@ -568,30 +568,41 @@ sub resolvedeps { message("PAKFIRE RESV: $pak: Dependency is already installed: $_"); } else { message("PAKFIRE RESV: $pak: Need to install dependency: $_"); - push(@tempdeps,$_); push(@all,$_); } } } - foreach (@tempdeps) { - if ($_) { - my @newdeps = resolvedeps("$_"); - foreach(@newdeps) { - unless (($_ eq " ") || ($_ eq "")) { - my $return = &isinstalled($_); - if ($return eq 0) { - message("PAKFIRE RESV: $pak: Dependency is already installed: $_"); - } else { - message("PAKFIRE RESV: $pak: Need to install dependency: $_"); - push(@all,$_); - } - } + return @all; +} + +sub resolvedeps { + my $pak = shift; + my @all; + + # Resolve all not yet installed dependencies of $pak + my @deps = &resolvedeps_one($pak); + push(@all, @deps); + + # For each dependency, we check if more dependencies exist + while (@deps) { + my $dep = pop(@deps); + + my @subdeps = &resolvedeps_one($dep); + foreach my $subdep (@subdeps) { + # Skip the package we are currently resolving for + next if ($pak eq $subdep); + + # If the package is not already to be installed, + # we add it to the list (@all) and check if it has + # more dependencies on its own. + unless (grep {$_ eq $subdep} @all) { + push(@deps, $subdep); + push(@all, $subdep); } } } - message(""); - chomp (@all); + return @all; } From d986a632cb9a9f77eeaf8f39f0baee4e5b668b08 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 7 Apr 2017 12:05:35 +0100 Subject: [PATCH 2/2] core110: Ship updated legacy style CSS Signed-off-by: Michael Tremer --- config/rootfiles/core/110/filelists/files | 1 + 1 file changed, 1 insertion(+) diff --git a/config/rootfiles/core/110/filelists/files b/config/rootfiles/core/110/filelists/files index f903fbd40..e8f9d2db0 100644 --- a/config/rootfiles/core/110/filelists/files +++ b/config/rootfiles/core/110/filelists/files @@ -13,6 +13,7 @@ srv/web/ipfire/cgi-bin/system.cgi srv/web/ipfire/cgi-bin/vpnmain.cgi srv/web/ipfire/html/themes/darkdos/include/style.css srv/web/ipfire/html/themes/ipfire/include/css/style.css +srv/web/ipfire/html/themes/ipfire-legacy/include/css/style.css srv/web/ipfire/html/themes/maniac/include/style.css usr/lib/firewall/ipsec-block usr/lib/libssp.so.0