public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, master, updated. d986a632cb9a9f77eeaf8f39f0baee4e5b668b08
@ 2017-04-07 11:06 git
  0 siblings, 0 replies; only message in thread
From: git @ 2017-04-07 11:06 UTC (permalink / raw)
  To: ipfire-scm

[-- Attachment #1: Type: text/plain, Size: 4710 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, master has been updated
       via  d986a632cb9a9f77eeaf8f39f0baee4e5b668b08 (commit)
       via  621dcd8609a26ffe98fcb7fff05202bf5eb41112 (commit)
      from  be3d3959d2e7ee03caf40e37993d6a815f8829bf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d986a632cb9a9f77eeaf8f39f0baee4e5b668b08
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Fri Apr 7 12:05:35 2017 +0100

    core110: Ship updated legacy style CSS
    
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

commit 621dcd8609a26ffe98fcb7fff05202bf5eb41112
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Fri Apr 7 12:04:02 2017 +0100

    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 <arne.fitzenreiter(a)ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 config/rootfiles/core/110/filelists/files |  2 ++
 src/pakfire/lib/functions.pl              | 47 +++++++++++++++++++------------
 2 files changed, 31 insertions(+), 18 deletions(-)

Difference in files:
diff --git a/config/rootfiles/core/110/filelists/files b/config/rootfiles/core/110/filelists/files
index 4a7d710..e8f9d2d 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
@@ -12,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
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl
index 11b1e37..c347916 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;
 }
 


hooks/post-receive
--
IPFire 2.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-07 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 11:06 [git.ipfire.org] IPFire 2.x development tree branch, master, updated. d986a632cb9a9f77eeaf8f39f0baee4e5b668b08 git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox