[pve-devel] [PATCH] Add extra optional list to pveversion

Wolfgang Link w.link at proxmox.com
Fri Aug 7 13:22:30 CEST 2015


if the packet on the opt list is not installed, it will not shown.
---
 PVE/API2/APT.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm
index 2eac330..b665a5b 100644
--- a/PVE/API2/APT.pm
+++ b/PVE/API2/APT.pm
@@ -536,9 +536,12 @@ __PACKAGE__->register_method({
 
 	# comment out old packages uses before 4.0
 	# clvm resource-agents-pve fence-agents-pve vzctl vzprocps vzquota
-	
+
+	my @opt_pack = ('zfsutils');
+
 	push @list, qw(lvm2 corosync-pve libqb0 pve-cluster qemu-server pve-firmware libpve-common-perl libpve-access-control libpve-storage-perl pve-libspice-server1 vncterm pve-qemu-kvm pve-container pve-firewall pve-ha-manager ksm-control-daemon glusterfs-client lxc-pve lxcfs cgmanager);
 
+	@list = (@list, @opt_pack);
 	my $pkglist = [];
 	
 	my (undef, undef, $kernel_release) = POSIX::uname();
@@ -567,6 +570,9 @@ __PACKAGE__->register_method({
 	    } elsif ($pkgname eq 'proxmox-ve') {
 		$res->{RunningKernel} = $kernel_release;
 	    }
+	    if (grep( /^$res->{Package}$/, @opt_pack)) {
+		next if $res->{CurrentState} eq 'NotInstalled';
+	    }
 
 	    push @$pkglist, $res;
 	}
-- 
2.1.4





More information about the pve-devel mailing list