[pve-devel] [PATCH stable5 proxmox-ve] apthook: detect upgrades from PVE 5.x to 6.0

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jun 26 21:01:02 CEST 2019


On 6/26/19 2:00 PM, Fabian Grünbichler wrote:
> and refer to the upgrade documentation.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> (cherry picked with adapted version numbers from commit 521ed9dfb36181f5853e34540b3c26b8665ac72f)

applied, with removed cherry-pick message

> ---
>  debian/apthook/pve-apt-hook | 47 +++++++++++++++++++++++--------------
>  1 file changed, 30 insertions(+), 17 deletions(-)
> 
> diff --git a/debian/apthook/pve-apt-hook b/debian/apthook/pve-apt-hook
> index 0ec017d..8b9b40e 100755
> --- a/debian/apthook/pve-apt-hook
> +++ b/debian/apthook/pve-apt-hook
> @@ -23,9 +23,12 @@ if (!defined $fd || $fd == 0) {
>  open(my $fh, "<&=${fd}") or die "E: could not open APT_HOOK_INFO_FD (${fd}) - $!\n";
>  
>  my $cleanup = sub {
> -  my ($rc) = @_;
> +  my ($rc, $confirm) = @_;
>  
>    close($fh);
> +
> +  my $line = <STDIN> if $confirm;
> +
>    exit $rc;
>  };
>  
> @@ -50,23 +53,33 @@ while (my $line = <$fh>) {
>      next;
>    }
>  
> -  if ($pkg eq 'proxmox-ve' && $action eq '**REMOVE**') {
> -    if (-e $check_file) {
> -      $log->("'$check_file' exists, proceeding with removal of package '${check_package}'\n");
> -      unlink $check_file;
> -    } else {
> -      $log->("!! WARNING !!\n");
> -      $log->("You are attempting to remove the meta-package '${check_package}'!\n");
> -      $log->("\n");
> -      $log->("If you really want to permanently remove '${check_package}' from your system, run the following command\n");
> -      $log->("\ttouch '${check_file}'\n");
> -      $log->("run apt purge ${check_package} to remove the meta-package\n");
> -      $log->("and repeat your apt invocation.\n");
> +  if ($pkg eq 'proxmox-ve') {
> +    if ($action eq '**REMOVE**') {
> +      if (-e $check_file) {
> +        $log->("'$check_file' exists, proceeding with removal of package '${check_package}'\n");
> +        unlink $check_file;
> +      } else {
> +        $log->("!! WARNING !!\n");
> +        $log->("You are attempting to remove the meta-package '${check_package}'!\n");
> +        $log->("\n");
> +        $log->("If you really want to permanently remove '${check_package}' from your system, run the following command\n");
> +        $log->("\ttouch '${check_file}'\n");
> +        $log->("run apt purge ${check_package} to remove the meta-package\n");
> +        $log->("and repeat your apt invocation.\n");
> +        $log->("\n");
> +        $log->("If you are unsure why '$check_package' would be removed, please verify\n");
> +        $log->("\t- your APT repository settings\n");
> +        $log->("\t- that you are using 'apt full-upgrade' to upgrade your system\n");
> +        $cleanup->(1);
> +      }
> +    } elsif ($action eq '**CONFIGURE**' && $dir eq '<' && $old =~ /^5\./ && $new =~ /^6\./) {
> +      $log->("!! ATTENTION !!\n");
> +      $log->("You are attempting to upgrade from proxmox-ve '$old' to proxmox-ve '$new'. Please make sure to read the Upgrade notes at\n");
> +      $log->("\thttps://pve.proxmox.com/wiki/Upgrade_from_5.x_to_6.0\n");
> +      $log->("before proceeding with this operation.\n");
>        $log->("\n");
> -      $log->("If you are unsure why '$check_package' would be removed, please verify\n");
> -      $log->("\t- your APT repository settings\n");
> -      $log->("\t- that you are using 'apt full-upgrade' to upgrade your system\n");
> -      $cleanup->(1);
> +      $log->("Press enter to continue, or C^c to abort.\n");
> +      $cleanup->(0, 1);
>      }
>    }
>  }
> 






More information about the pve-devel mailing list