pakfire.cgi: Suppress display of dependencies for install and remove boxes
Commit Message
- For the install <select> box, suppress the display of package
names starting with lib, perl, and python3. This does not
suppress the display of all dependencies, but does remove
68 packages from the display.
- As a special case, keep libvirt in the display. It is a
top level package.
- For the remove <select> box, suppress the display of package
dependencies.
- As a special case, keep rsync in the display. It is a top
level package as well as a dependency of rsnapshot.
- lfs/freeradius: Remove samba as a dependency of freeradius.
While commonly used with samba, freeradius is a standalone package.
- lfs/libvirt: Remove qemu as a dependency of libvirt.
While commonly used with qemu, libvirt is a standalone package.
- lfs/mpc: Remove mpd as a dependency of mpc.
While only used with mpd, mpc is a standalone package.
- lfs/mympd: Remove mpd as a dependency of mympd.
While only used with mpd, mympd is a standalone package.
- lfs/vdradmin: Remove vdr as a dependency of vdradmin.
While only used with vdr, vdradmin is a standalone package.
Signed-off-by: Stephen Cuka <stephen@firemypi.org>
---
html/cgi-bin/pakfire.cgi | 35 ++++++++++++++++++++++++++++++++---
lfs/freeradius | 2 +-
lfs/libvirt | 2 +-
lfs/mpc | 2 +-
lfs/mympd | 2 +-
lfs/vdradmin | 2 +-
6 files changed, 37 insertions(+), 8 deletions(-)
@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2025 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 #
@@ -786,6 +786,18 @@ END
END
my %notinstalledlist = &Pakfire::dblist("notinstalled");
+
+ # remove dependencies which start with lib, perl, python3
+ # from list to display
+ # special case - keep libvirt as a top level package
+ my %keep;
+ @keep{libvirt} = @notinstalledlist{libvirt} if exists $notinstalledlist{libvirt};
+ for (keys %notinstalledlist)
+ {
+ delete $notinstalledlist{$_} if $_ =~ /^lib|^perl|^python3/;
+ }
+ @notinstalledlist{libvirt} = @keep{libvirt} if exists $keep{libvirt};
+
foreach my $pak (sort keys %notinstalledlist) {
print "<option value=\"$pak\">$pak-$notinstalledlist{$pak}{'ProgVersion'}-$notinstalledlist{$pak}{'Release'}</option>\n";
}
@@ -798,6 +810,24 @@ END
END
my %installedlist = &Pakfire::dblist("installed");
+
+ # remove dependencies packages from list to display
+ # special case - keep rsync as a top level package
+ my $instdir = "/opt/pakfire/db/installed";
+ my @inst_deps = deps_from_metafiles($instdir);
+ my @inst_deps_noparent;
+ foreach (@inst_deps)
+ {
+ push @inst_deps_noparent, $_ =~ /.+:(.+)/;
+ }
+ my %keep;
+ @keep{rsync} = @installedlist{rsync} if exists $installedlist{rsync};
+ foreach (@inst_deps_noparent)
+ {
+ delete $installedlist{$_};
+ }
+ @installedlist{rsync} = @keep{rsync} if exists $keep{rsync};
+
foreach my $pak (sort keys %installedlist) {
print "<option value=\"$pak\">$pak-$installedlist{$pak}{'ProgVersion'}-$installedlist{$pak}{'Release'}</option>\n";
}
@@ -967,8 +997,7 @@ sub arrow_format
return $line;
}
-# build dependencies tree from array of package
-# dependencies
+# build dependencies tree from array of package dependencies
sub build_tree
{
my $pref = $_[0];
@@ -36,7 +36,7 @@ TARGET = $(DIR_INFO)/$(THISAPP)
PROG = freeradius
PAK_VER = 23
-DEPS = libtalloc samba
+DEPS = libtalloc
SERVICES = freeradius
@@ -37,7 +37,7 @@ SUP_ARCH = x86_64 aarch64
PROG = libvirt
PAK_VER = 38
-DEPS = ebtables libpciaccess ovmf qemu
+DEPS = ebtables libpciaccess ovmf
SERVICES = libvirtd virtlogd
@@ -36,7 +36,7 @@ TARGET = $(DIR_INFO)/$(THISAPP)
PROG = mpc
PAK_VER = 10
-DEPS = mpd libmpdclient
+DEPS = libmpdclient
SERVICES =
@@ -36,7 +36,7 @@ TARGET = $(DIR_INFO)/$(THISAPP)
PROG = mympd
PAK_VER = 10
-DEPS = mpd libmpdclient
+DEPS = libmpdclient
SERVICES = mympd
@@ -37,7 +37,7 @@ TARGET = $(DIR_INFO)/$(THISAPP)
PROG = vdradmin
PAK_VER = 7
-DEPS = perl-gettext vdr vdr_epgsearch
+DEPS = perl-gettext vdr_epgsearch
SERVICES = vdradmin