]>
git.proxmox.com Git - proxmox-ve.git/blob - debian/apthook/pve-apt-hook
8 my $fd = $ENV{APT_HOOK_INFO_FD
};
9 my $check_file = '/please-remove-proxmox-ve';
10 my $check_package = 'proxmox-ve';
11 my $hook_name = basename
($0);
15 print "W: ($hook_name) $line";
18 if (!defined $fd || $fd == 0) {
19 $log->("APT_HOOK_INFO_FD not correctly defined, skipping apt-pve-hook checks\n");
23 open(my $fh, "<&=${fd}") or die "E: could not open APT_HOOK_INFO_FD (${fd}) - $!\n";
32 chomp (my $ver = <$fh>);
33 if ($ver ne "VERSION 2") {
34 $log->("apt-pve-hook misconfigured, expecting hook protocol version 2\n");
39 while (my $line = <$fh>) {
42 if (!defined($blank)) {
47 my ($pkg, $old, $dir, $new, $action) = (split / /, $line, 5);
48 if (!defined($action)) {
49 $log->("apt-pve-hook encountered unexpected line: $line\n");
53 if ($pkg eq 'proxmox-ve' && $action eq '**REMOVE**') {
55 $log->("'$check_file' exists, proceeding with removal of package '${check_package}'\n");
58 $log->("!! WARNING !!\n");
59 $log->("You are attempting to remove the meta-package '${check_package}'!\n");
61 $log->("If you really you want to permanently remove '${check_package}' from your system, run the following command\n");
62 $log->("\ttouch '${check_file}'\n");
63 $log->("run apt purge ${check_package} to remove the meta-package\n");
64 $log->("and repeat your apt invocation.\n");
66 $log->("If you are unsure why '$check_package' would be removed, please verify\n");
67 $log->("\t- your APT repository settings\n");
68 $log->("\t- that you are using 'apt full-upgrade' to upgrade your system\n");