mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 21:12:59 +02:00
pakfire: fix dep resolve at upgrade.
This commit is contained in:
committed by
Arne Fitzenreiter
parent
b47472c186
commit
9f1f68f17a
@@ -2,7 +2,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
|
||||
# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -589,6 +589,25 @@ sub resolvedeps {
|
||||
return @all;
|
||||
}
|
||||
|
||||
sub resolvedeps_recursive {
|
||||
my @packages = shift;
|
||||
my @result = ();
|
||||
|
||||
foreach my $pkg (@packages) {
|
||||
my @deps = &Pakfire::resolvedeps($pkg);
|
||||
|
||||
foreach my $dep (@deps) {
|
||||
push(@result, $dep);
|
||||
}
|
||||
}
|
||||
|
||||
# Sort the result array and remove dupes
|
||||
my %sort = map{ $_, 1 } @result;
|
||||
@result = keys %sort;
|
||||
|
||||
return @result;
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $dir = shift;
|
||||
my $path;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
|
||||
# Copyright (C) 2007-2015 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -255,14 +255,11 @@
|
||||
} elsif ("$ARGV[0]" eq "upgrade") {
|
||||
&Pakfire::upgradecore();
|
||||
my @upgradepaks = &Pakfire::dblist("upgrade", "noweb");
|
||||
my @temp, $pak;
|
||||
|
||||
foreach (@upgradepaks) {
|
||||
@temp = &Pakfire::resolvedeps("$_");
|
||||
foreach (@temp) { push(@upgradepaks,$_) if $_; }
|
||||
}
|
||||
|
||||
|
||||
if (@upgradepaks) {
|
||||
# Resolve the dependencies of the to be upgraded packages
|
||||
my @deps = &Pakfire::resolvedeps_recursive(@upgradepaks);
|
||||
|
||||
&Pakfire::message("");
|
||||
&Pakfire::message("PAKFIRE UPGR: We are going to install all packages listed above.");
|
||||
if ($interactive) {
|
||||
@@ -277,16 +274,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
### Download first
|
||||
# Download packages
|
||||
foreach $pak (@upgradepaks) {
|
||||
#system("mv $Conf::dbdir/meta/meta-$pak $Conf::dbdir/meta/old-meta-$pak");
|
||||
&Pakfire::getpak("$pak", "");
|
||||
}
|
||||
|
||||
|
||||
# Download dependencies
|
||||
foreach $pak (@deps) {
|
||||
&Pakfire::getpak("$pak", "");
|
||||
}
|
||||
|
||||
# Install dependencies first
|
||||
foreach $pak (@deps) {
|
||||
&Pakfire::setuppak("$pak");
|
||||
}
|
||||
|
||||
# Install all upgrades
|
||||
foreach $pak (@upgradepaks) {
|
||||
if (&Pakfire::upgradepak("$pak")) {
|
||||
#system("mv $Conf::dbdir/meta/old-meta-$pak $Conf::dbdir/meta/meta-$pak");
|
||||
}
|
||||
&Pakfire::upgradepak("$pak");
|
||||
}
|
||||
|
||||
} elsif ("$ARGV[0]" eq "list") {
|
||||
|
||||
Reference in New Issue
Block a user