mirror of
https://git.proxmox.com/git/pve-client
synced 2025-10-05 06:52:26 +00:00
add code to print perl package dependencies
We want to minimize that list ...
This commit is contained in:
parent
a8aa5b6371
commit
f5fcd82647
19
pveclient
19
pveclient
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use Cwd 'abs_path';
|
||||||
use lib '/usr/share/pve-client';
|
use lib '/usr/share/pve-client';
|
||||||
use lib '.';
|
use lib '.';
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
@ -113,6 +114,24 @@ if ($cmd eq 'get') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elsif ($cmd eq 'packagedepends') {
|
||||||
|
# experimental code to print required perl packages
|
||||||
|
my $packages = {};
|
||||||
|
my $dir = Cwd::getcwd;
|
||||||
|
|
||||||
|
foreach my $k (keys %INC) {
|
||||||
|
my $file = abs_path($INC{$k});
|
||||||
|
next if $file =~ m/^\Q$dir\E/;
|
||||||
|
my $res = `dpkg -S '$file'`;
|
||||||
|
if ($res && $res =~ m/^(\S+): $file$/) {
|
||||||
|
my $debian_package = $1;
|
||||||
|
$debian_package =~ s/:amd64$//;
|
||||||
|
$packages->{$debian_package} = 1;
|
||||||
|
} else {
|
||||||
|
die "unable to find package for '$file'\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print join("\n", sort(keys %$packages)) . "\n";
|
||||||
} else {
|
} else {
|
||||||
print_usage();
|
print_usage();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user