mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Fix to significantly simplify check for different distros
This commit is contained in:
@@ -12,7 +12,7 @@ my @d = split(/\0/, $in{'d'});
|
||||
my $vmap = &get_virtualmin_php_map();
|
||||
|
||||
# Find all packages and check that they can be safely removed
|
||||
my @pkgs = &list_any_php_base_packages();
|
||||
my @pkgs = &list_php_base_packages();
|
||||
my @delpkgs;
|
||||
foreach my $name (@d) {
|
||||
($pkg) = grep { $_->{'name'} eq $name } @pkgs;
|
||||
|
||||
@@ -7,7 +7,7 @@ $access{'global'} || &error($text{'pkgs_ecannot'});
|
||||
|
||||
&ui_print_header(undef, $text{'pkgs_title'}, "");
|
||||
|
||||
my @pkgs = &list_any_php_base_packages();
|
||||
my @pkgs = &list_php_base_packages();
|
||||
my %got;
|
||||
if (@pkgs) {
|
||||
my $vmap = &get_virtualmin_php_map();
|
||||
|
||||
@@ -866,7 +866,7 @@ else {
|
||||
return @poss;
|
||||
}
|
||||
|
||||
# list_php_base_packages([common])
|
||||
# list_php_base_packages()
|
||||
# Returns a list of hash refs, one per PHP version installed, with the
|
||||
# following keys :
|
||||
# name - Package name
|
||||
@@ -875,19 +875,13 @@ return @poss;
|
||||
# phpver - PHP version
|
||||
sub list_php_base_packages
|
||||
{
|
||||
my ($common) = @_;
|
||||
&foreign_require("software");
|
||||
my $n = &software::list_packages();
|
||||
my @rv;
|
||||
my %done;
|
||||
for(my $i=0; $i<$n; $i++) {
|
||||
my $name = $software::packages{$i,'name'};
|
||||
if ($common) {
|
||||
next if ($name !~ /^(php(?:\d+(?:\.\d+)?)?(?:-php)?-common)$/);
|
||||
}
|
||||
else {
|
||||
next if ($name !~ /^php(\d*)$/);
|
||||
}
|
||||
next unless ($name =~ /^((?:rh-)?php(?:\d[\d.]*)?(?:-php)?-common|php\d*[\d.]*)$/);
|
||||
$name = $1;
|
||||
my $phpver = $software::packages{$i,'version'};
|
||||
$phpver =~ s/\-.*$//;
|
||||
@@ -920,20 +914,6 @@ for(my $i=0; $i<$n; $i++) {
|
||||
return sort { &compare_version_numbers($a->{'ver'}, $b->{'ver'}) } @rv;
|
||||
}
|
||||
|
||||
# list_any_php_base_packages()
|
||||
# Returns a list of all PHP base packages, either common or full,
|
||||
# sorted by version number. If no common packages are available, the
|
||||
# full PHP packages are used instead, mainly for non-Linux systems
|
||||
sub list_any_php_base_packages
|
||||
{
|
||||
my @rv = &list_php_base_packages(1);
|
||||
if (!@rv) {
|
||||
# If no common packages, then use the full PHP packages
|
||||
@rv = &list_php_base_packages();
|
||||
}
|
||||
return sort { &compare_version_numbers($a->{'ver'}, $b->{'ver'}) } @rv;
|
||||
}
|
||||
|
||||
# list_all_php_module_packages(base-package)
|
||||
# Returns all install packages for PHP extensions of a given base package
|
||||
sub list_all_php_module_packages
|
||||
|
||||
Reference in New Issue
Block a user