@@ -631,6 +631,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependecies found
WARNING: translation string unused: pakfire health check
@@ -1447,10 +1447,10 @@ WARNING: untranslated string: ovpn tls auth = TLS Channel Protection:
WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br>
WARNING: untranslated string: pagerefresh = Page is beeing refreshed, please wait.
WARNING: untranslated string: pak update = Update
-WARNING: untranslated string: pakfire accept all = Do you want to install all packages?
WARNING: untranslated string: pakfire ago = ago.
WARNING: untranslated string: pakfire already busy = Pakfire is already performing a task. Please try again later.
WARNING: untranslated string: pakfire available addons = Available Add-ons:
+WARNING: untranslated string: pakfire check deps = Checking dependencies...
WARNING: untranslated string: pakfire configuration = Pakfire Configuration
WARNING: untranslated string: pakfire confirm upgrades = Do you want to install all upgrades?
WARNING: untranslated string: pakfire core update level = Core-Update-Level
@@ -1458,7 +1458,7 @@ WARNING: untranslated string: pakfire finished = Pakfire has finished! Returning
WARNING: untranslated string: pakfire finished error = Pakfire has finished! Errors occurred, please check the log output before proceeding.
WARNING: untranslated string: pakfire install = Install
WARNING: untranslated string: pakfire install description = Please select one or more add-ons to install.
-WARNING: untranslated string: pakfire install package = You want to install the following packages:
+WARNING: untranslated string: pakfire install package = Packages to install:
WARNING: untranslated string: pakfire installed addons = Installed Add-ons:
WARNING: untranslated string: pakfire invalid tree = Invalid repository selected
WARNING: untranslated string: pakfire last core list update = Last core list update made
@@ -686,6 +686,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -661,6 +661,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -615,6 +615,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -614,6 +614,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -539,6 +539,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -534,6 +534,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -644,6 +644,7 @@ WARNING: translation string unused: ovpn_processprioVH
WARNING: translation string unused: ovpnstatus log
WARNING: translation string unused: ovpnsys log
WARNING: translation string unused: package failed to install
+WARNING: translation string unused: pakfire accept all
WARNING: translation string unused: pakfire core update auto
WARNING: translation string unused: pakfire dependencies found
WARNING: translation string unused: pakfire health check
@@ -278,30 +278,127 @@ if (($cgiparams{'ACTION'} eq $Lang::tr{'pakfire install'}) && ($pagemode eq $PM_
&Header::openbox("100%", "center", $Lang::tr{'pakfire install'});
my @pkgs = split(/\|/, $cgiparams{'INSPAKS'});
- my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
+
print <<END;
- <table style="width: 100%">
+ <table style="width: 100%">
<tr>
<td>
- <p>$Lang::tr{'pakfire install package'} <strong>@{pkgs}</strong><br>$Lang::tr{'pakfire possible dependency'}</p>
+ $Lang::tr{'pakfire install package'} <strong>
+END
+
+ foreach (my $i = 0; $i < $#pkgs; $i++)
+ {
+ print "$pkgs[$i], ";
+ }
+ print "$pkgs[$#pkgs]";
+
+ print <<END;
+ </strong>
+ <br><br>$Lang::tr{'pakfire check deps'}
<pre>
END
- foreach (@output) {
- $_ =~ s/\\[[0-1]\;[0-9]+m//g;
- print "$_\n";
+
+ # get dependencies from pakfire resolvedeps output
+ my @pkgs_deps;
+ my @errors;
+ my @output = &General::system_output("/usr/local/bin/pakfire", "resolvedeps", "--no-colors", @pkgs);
+ foreach (@output)
+ {
+ if ($_ =~ /install/)
+ {
+ (my $package) = $_ =~ /.+:\s(.+):\s.+:\s.+/;
+ (my $dependency) = $_ =~ /.+:\s.+:\s.+:\s(.+)/;
+ push @pkgs_deps, "$package:$dependency";
+ }
+ if ($_ =~ /ERROR/)
+ {
+ push @errors, $_;
+ }
+ }
+
+ if (@errors)
+ {
+ chomp @errors;
+ print "\nErrors occurred:\n";
+ foreach (@errors)
+ {
+ print "$_\n";
+ }
+ }
+
+ # get dependencies from metafiles
+ my $instdir = "/opt/pakfire/db/installed";
+ my @inst_deps = deps_from_metafiles($instdir);
+ my $metadir = "/opt/pakfire/db/meta";
+ my @meta_deps = deps_from_metafiles($metadir);
+
+ my @all_deps = @inst_deps;
+ push @all_deps, @meta_deps;
+
+ my %dedupe;
+ @all_deps = grep { ! $dedupe{ $_ }++ } @all_deps;
+
+ # build dependencies tree
+ my @search = @pkgs_deps;
+ my @pkgs_deps_tree;
+ my @temp;
+ do
+ {
+ @temp = ();
+ foreach my $i (@search)
+ {
+ (my $child) = $i =~ /.+:(.+)/;
+ foreach my $j (@all_deps)
+ {
+ (my $all_deps_parent) = $j =~ /(.+):.+/;
+ (my $all_deps_child) = $j =~ /.+:(.+)/;
+ if ( $child eq $all_deps_parent )
+ {
+ push @temp, "$i:$all_deps_child";
+ }
+ }
+ }
+ push @pkgs_deps_tree, @temp;
+ @search = @temp;
+ } until ( ! (@search));
+
+ push @pkgs_deps, @pkgs_deps_tree;
+
+ @pkgs_deps = sort @pkgs_deps;
+
+ my @installed = get_package_names($instdir);
+
+ # display dependencies
+ print "\nPackage dependencies:\n";
+ foreach my $i (@pkgs)
+ {
+ print "\n Package: $i\n";
+ if (grep (/^$i/, @pkgs_deps))
+ {
+ foreach my $j (@pkgs_deps)
+ {
+ if (grep (/$i/, $j))
+ {
+ (my $child) = $j =~ /.+:(.+)/;
+ if (grep (/$child/, @installed))
+ {
+ print " " . (arrow_format($j)) . "<span style='font-size:80%'> (already installed)</span>\n";
+ } else {
+ print " " . (arrow_format($j)) . "\n";
+ }
+ }
+ }
+ } else {
+ print " No dependencies found.\n";
+ }
}
+
print <<END;
</pre>
</td>
</tr>
<tr>
- <td>$Lang::tr{'pakfire accept all'}</td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td align='center'>
+ <td align='center' style='padding-top:8px;padding-bottom:4px'>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='INSPAKS' value='$cgiparams{'INSPAKS'}' />
<input type='hidden' name='FORCE' value='on' />
@@ -638,3 +735,71 @@ sub _http_pagemode_redirect {
$pagemode = $mode;
}
}
+
+# search package metafiles in $dir and return array of
+# dependencies in parent:child format
+sub deps_from_metafiles
+{
+ my $dir = $_[0];
+ my @packages = ();
+ my @temp = ();
+ my @found_deps = ();
+ my @files = glob("$dir/meta-*");
+
+ foreach (@files)
+ {
+ (my $pak) = $_ =~ /.+\/meta\-([\w\-]+)$/;
+ push @packages, $pak;
+ }
+
+ foreach my $i (@packages)
+ {
+ open(META, "<", "$dir/meta-$i") or die "Cannot open file meta-$i: $!";
+ my @data = <META>;
+ close(META);
+
+ my $line = '';
+ foreach (@data)
+ {
+ $line = $_;
+ last if (grep(/Dependencies:/, $line));
+ }
+
+ chomp $line;
+ @temp = split(' ', $line);
+ @temp = grep {$_ ne 'Dependencies:'} @temp;
+ foreach (@temp)
+ {
+ push @found_deps, "$i:$_";
+ }
+ }
+ return @found_deps;
+}
+
+# return package names from a metafile directory
+sub get_package_names
+{
+ my $dir = $_[0];
+ my @files = ();
+ my @temp = glob("$dir/meta-*");
+ foreach (@temp)
+ {
+ (my $name) = $_ =~ /.+\/meta\-([\w\-]+)$/;
+ push @files, $name;
+ }
+ return @files;
+}
+
+# convert a string in 'parent:child:child...' format to
+# 'parent -> child -> child -> ...' format
+sub arrow_format
+{
+ my $line = '';
+ my @items = split(/:/, $_[0]);
+ foreach my $i (@items)
+ {
+ $line = $line . "$i -> ";
+ }
+ $line = substr($line, 0, -4);
+ return $line;
+}
@@ -2010,6 +2010,7 @@
'pakfire ago' => 'her.',
'pakfire already busy' => 'Pakfire führt bereits eine Aufgabe aus. Bitte versuchen Sie es später erneut.',
'pakfire available addons' => 'Verfügbare Add-ons:',
+'pakfire check deps' => 'Überprüfung der Abhängigkeiten...',
'pakfire configuration' => 'Pakfire Konfiguration',
'pakfire confirm upgrades' => 'Möchten Sie alle Upgrades installieren?',
'pakfire core update auto' => 'Core- und Add-on-Updates automatisch installieren:',
@@ -2020,7 +2021,7 @@
'pakfire health check' => 'Mirrors auf Erreichbarkeit prüfen (Ping):',
'pakfire install' => 'Installieren',
'pakfire install description' => 'Bitte wählen Sie ein oder mehrere Add-Ons zur Installation aus.',
-'pakfire install package' => 'Sie möchten folgende Pakete installieren: ',
+'pakfire install package' => 'Zu installierende Pakete:',
'pakfire installed addons' => 'Installierte Add-ons:',
'pakfire invalid tree' => '',
'pakfire last core list update' => 'Letztes Corelisten Update ist',
@@ -2076,6 +2076,7 @@
'pakfire ago' => 'ago.',
'pakfire already busy' => 'Pakfire is already performing a task. Please try again later.',
'pakfire available addons' => 'Available Add-ons:',
+'pakfire check deps' => 'Checking dependencies...',
'pakfire configuration' => 'Pakfire Configuration',
'pakfire confirm upgrades' => 'Do you want to install all upgrades?',
'pakfire core update auto' => 'Install core and add-on updates automatically:',
@@ -2086,7 +2087,7 @@
'pakfire health check' => 'Check if mirror is reachable (ping):',
'pakfire install' => 'Install',
'pakfire install description' => 'Please select one or more add-ons to install.',
-'pakfire install package' => 'You want to install the following packages: ',
+'pakfire install package' => 'Packages to install:',
'pakfire installed addons' => 'Installed Add-ons:',
'pakfire invalid tree' => 'Invalid repository selected',
'pakfire last core list update' => 'Last core list update made',
@@ -2073,6 +2073,7 @@
'pakfire ago' => '',
'pakfire already busy' => 'Pakfire ya está realizando una tarea. Por favor, inténtelo de nuevo más tarde.',
'pakfire available addons' => 'Complementos disponibles:',
+'pakfire check deps' => 'Comprobando dependencias...',
'pakfire configuration' => 'Configuración de Pakfire',
'pakfire confirm upgrades' => '¿Quieres instalar todas las actualizaciones?',
'pakfire core update auto' => 'Instar actualizaciones principales y complementarias automáticamente:',
@@ -2083,7 +2084,7 @@
'pakfire health check' => 'Verificar disponibilidad del espejo (ping):',
'pakfire install' => 'Instalar',
'pakfire install description' => 'Seleccione uno o más complementos para instalar.',
-'pakfire install package' => 'Ud. desea instalar los siguientes paquetes:',
+'pakfire install package' => 'Paquetes a instalar:',
'pakfire installed addons' => 'Complementos instalados:',
'pakfire invalid tree' => 'Repositorio no válido seleccionado',
'pakfire last core list update' => 'Última lista de actualización de núcleo hecha',
@@ -2071,6 +2071,7 @@
'pakfire ago' => '',
'pakfire already busy' => 'Pakfire est déjà en train d\'effectuer une tâche. Veuillez réessayer plus tard.',
'pakfire available addons' => 'Modules disponibles :',
+'pakfire check deps' => 'Vérification des dépendances...',
'pakfire configuration' => 'Configuration Pakfire',
'pakfire confirm upgrades' => 'Voulez-vous installer toutes les mises à niveau ?',
'pakfire core update auto' => 'Installer automatiquement les mises à jour du noyau et des modules :',
@@ -2081,7 +2082,7 @@
'pakfire health check' => 'Vérifier si le miroir est accessible (ping) :',
'pakfire install' => 'Installer',
'pakfire install description' => 'Veuillez sélectionner un ou plusieurs modules complémentaires à installer.',
-'pakfire install package' => 'Vous souhaitez installer le(s) module(s) suivant(s) : ',
+'pakfire install package' => 'Paquets à installer :',
'pakfire installed addons' => 'Modules installés :',
'pakfire invalid tree' => 'Dépôt choisi invalide',
'pakfire last core list update' => 'Dernière mise à jour de la liste du noyau : ',
@@ -1711,6 +1711,7 @@
'pakfire accept all' => 'Vuoi installare tutti i pacchetti?',
'pakfire ago' => 'ago.',
'pakfire available addons' => 'Addons disponibili:',
+'pakfire check deps' => 'Controllo delle dipendenze...',
'pakfire configuration' => 'Configurazione Pakfire',
'pakfire confirm upgrades' => 'Vuoi installare tutti gli aggiornamenti?',
'pakfire core update auto' => 'Install core and addon updates automatically:',
@@ -1719,7 +1720,7 @@
'pakfire health check' => 'Controllare se il mirror è raggiungibile (ping):',
'pakfire install' => 'Installare',
'pakfire install description' => 'Selezionare uno o più componenti aggiuntivi da installare.',
-'pakfire install package' => 'You want to install the following packages: ',
+'pakfire install package' => 'Pacchetti da installare:',
'pakfire installed addons' => 'Addons installati:',
'pakfire last core list update' => 'Ultimo aggiornamento della lista di sistema',
'pakfire last package update' => 'Ultimo aggiornamento della lista pacchetti',
@@ -1686,6 +1686,7 @@
'pakfire accept all' => 'Wilt u alle pakketten installeren?',
'pakfire ago' => 'geleden.',
'pakfire available addons' => 'Beschikbare add-ons:',
+'pakfire check deps' => 'Afhankelijkheden controleren...',
'pakfire configuration' => 'Pakfire configuratie',
'pakfire confirm upgrades' => 'Wilt u alle upgrades installeren?',
'pakfire core update auto' => 'Installeer core- en extensie-updates automatisch:',
@@ -1694,7 +1695,7 @@
'pakfire health check' => 'Controleer of de mirror bereikbaar is (ping):',
'pakfire install' => 'Installeren',
'pakfire install description' => 'Selecteer een of meer add-ons om te installeren.',
-'pakfire install package' => 'U wilt de volgende pakketten installeren: ',
+'pakfire install package' => 'Pakketten om te installeren:',
'pakfire installed addons' => 'Geïnstalleerde add-ons:',
'pakfire last core list update' => 'Laatste core-lijst update gemaakt',
'pakfire last package update' => 'Laatste pakketlijst update gemaakt',
@@ -1351,6 +1351,7 @@
'pakfire accept all' => 'Czy chcesz zainstalować wszystkie pakiety?',
'pakfire ago' => 'temu.',
'pakfire available addons' => 'Dostępne dodatki:',
+'pakfire check deps' => 'Sprawdzanie zależności...',
'pakfire configuration' => 'Konfiguracja Pakfire',
'pakfire confirm upgrades' => 'Czy chcesz zainstalować wszystkie aktualizacje?',
'pakfire core update auto' => 'Instaluj aktualizacje jądra automatycznie:',
@@ -1359,7 +1360,7 @@
'pakfire health check' => 'Sprawdź czy mirror jest dostępny (ping):',
'pakfire install' => 'Instaluj',
'pakfire install description' => 'Wybierz jeden lub więcej dodatków do zainstalowania.',
-'pakfire install package' => 'Zamierzasz zainstalować następujące pakiety: ',
+'pakfire install package' => 'Pakiety do zainstalowania:',
'pakfire installed addons' => 'Zainstalowane dodatki:',
'pakfire last core list update' => 'Sprawdzenie aktualizacja jądra:',
'pakfire last package update' => 'Ostatnia aktualizacja listy pakietów:',
@@ -1346,6 +1346,7 @@
'pakfire accept all' => 'Do you want to install all packages?',
'pakfire ago' => 'назад.',
'pakfire available addons' => 'Доступные Аддоны:',
+'pakfire check deps' => 'Проверка зависимостей...',
'pakfire configuration' => 'Pakfire Configuration',
'pakfire confirm upgrades' => 'Вы хотите установить все обновления?',
'pakfire core update auto' => 'Устанавливать обновления ядра и аддонов автоматически:',
@@ -1354,7 +1355,7 @@
'pakfire health check' => 'Пинговать зеркало на доступность:',
'pakfire install' => 'Установить',
'pakfire install description' => 'Пожалуйста, выберите одно или несколько дополнений для установки.',
-'pakfire install package' => 'Вы собираетесь установить следующие пакеты: ',
+'pakfire install package' => 'Пакеты для установки:',
'pakfire installed addons' => 'Установленные Аддоны:',
'pakfire last core list update' => 'Обновление core-списков',
'pakfire last package update' => 'Обновление списка пакетов',
@@ -1855,6 +1855,7 @@
'pakfire accept all' => 'Tüm paketleri yüklemek istiyor musunuz?',
'pakfire ago' => 'önce yapıldı.',
'pakfire available addons' => 'Mevcut eklentiler:',
+'pakfire check deps' => 'Bağımlılıklar kontrol ediliyor...',
'pakfire configuration' => 'Pakfire yapılandırması',
'pakfire confirm upgrades' => 'Tüm yükseltmeleri yüklemek istiyor musunuz?',
'pakfire core update auto' => 'Otomatik olarak çekirdek ve eklenti güncelleştirmelerini yükle:',
@@ -1863,7 +1864,7 @@
'pakfire health check' => 'Yansımanın ulaşılabilir olup olmadığını kontrol et (ping):',
'pakfire install' => 'Yükle',
'pakfire install description' => 'Lütfen yüklemek için bir veya daha fazla eklenti seçin.',
-'pakfire install package' => 'Aşağıdaki paketleri yüklemek istediniz: ',
+'pakfire install package' => 'Kurulacak paketler:',
'pakfire installed addons' => 'Kurulu eklentiler:',
'pakfire last core list update' => 'Son çekirdek listesi güncellemesi',
'pakfire last package update' => 'Son paket listesi güncellemesi',