From 920c82fb9bbeb351c5c786bb86e2a54255101d30 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 13 Jun 2023 15:14:15 +0200 Subject: [PATCH] debian: update postinst, postrm and prerm script style Signed-off-by: Thomas Lamprecht --- debian/pve-kernel.postinst.in | 10 +++++----- debian/pve-kernel.postrm.in | 28 ++++++++++++++-------------- debian/pve-kernel.prerm.in | 10 +++++----- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/debian/pve-kernel.postinst.in b/debian/pve-kernel.postinst.in index 3340eee..d35dad5 100755 --- a/debian/pve-kernel.postinst.in +++ b/debian/pve-kernel.postinst.in @@ -1,6 +1,7 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; +use warnings; # Ignore all invocations except when called on to configure. exit 0 unless $ARGV[0] =~ /configure/; @@ -16,10 +17,9 @@ system("depmod $version"); if (-d "/etc/kernel/postinst.d") { print STDERR "Examining /etc/kernel/postinst.d.\n"; - system ("run-parts --verbose --exit-on-error --arg=$version " . - "--arg=$imagedir/vmlinuz-$version " . - "/etc/kernel/postinst.d") && - die "Failed to process /etc/kernel/postinst.d"; + system( + "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postinst.d" + ) && die "Failed to process /etc/kernel/postinst.d"; } exit 0 diff --git a/debian/pve-kernel.postrm.in b/debian/pve-kernel.postrm.in index f0f56f7..019d5e9 100644 --- a/debian/pve-kernel.postrm.in +++ b/debian/pve-kernel.postrm.in @@ -1,6 +1,7 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; +use warnings; # Ignore all 'upgrade' invocations . exit 0 if $ARGV[0] =~ /upgrade/; @@ -11,10 +12,9 @@ my $version = "@@KVNAME@@"; if (-d "/etc/kernel/postrm.d") { print STDERR "Examining /etc/kernel/postrm.d.\n"; - system ("run-parts --verbose --exit-on-error --arg=$version " . - "--arg=$imagedir/vmlinuz-$version " . - "/etc/kernel/postrm.d") && - die "Failed to process /etc/kernel/postrm.d"; + system ( + "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postrm.d" + ) && die "Failed to process /etc/kernel/postrm.d"; } unlink "$imagedir/initrd.img-$version"; @@ -25,15 +25,15 @@ unlink "/var/lib/initramfs-tools/$version"; exit 0 unless $ARGV[0] =~ /purge/; my @files_to_remove = qw{ - modules.dep modules.isapnpmap modules.pcimap - modules.usbmap modules.parportmap - modules.generic_string modules.ieee1394map - modules.ieee1394map modules.pnpbiosmap - modules.alias modules.ccwmap modules.inputmap - modules.symbols modules.ofmap - modules.seriomap modules.*.bin - modules.softdep modules.devname - }; + modules.dep modules.isapnpmap modules.pcimap + modules.usbmap modules.parportmap + modules.generic_string modules.ieee1394map + modules.ieee1394map modules.pnpbiosmap + modules.alias modules.ccwmap modules.inputmap + modules.symbols modules.ofmap + modules.seriomap modules.*.bin + modules.softdep modules.devname +}; foreach my $extra_file (@files_to_remove) { for (glob("/lib/modules/$version/$extra_file")) { diff --git a/debian/pve-kernel.prerm.in b/debian/pve-kernel.prerm.in index 486f867..3c25fe6 100755 --- a/debian/pve-kernel.prerm.in +++ b/debian/pve-kernel.prerm.in @@ -1,6 +1,7 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl use strict; +use warnings; # Ignore all invocations uxcept when called on to remove exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ; @@ -14,10 +15,9 @@ my $version = "@@KVNAME@@"; if (-d "/etc/kernel/prerm.d") { print STDERR "Examining /etc/kernel/prerm.d.\n"; - system ("run-parts --verbose --exit-on-error --arg=$version " . - "--arg=$imagedir/vmlinuz-$version " . - "/etc/kernel/prerm.d") && - die "Failed to process /etc/kernel/prerm.d"; + system( + "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/prerm.d" + ) && die "Failed to process /etc/kernel/prerm.d"; } exit 0