debian: update postinst, postrm and prerm script style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-06-13 15:14:15 +02:00
parent 9edf7f3338
commit 14c9961f1d
3 changed files with 24 additions and 24 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl
use strict; use strict;
use warnings;
# Ignore all invocations except when called on to configure. # Ignore all invocations except when called on to configure.
exit 0 unless $ARGV[0] =~ /configure/; exit 0 unless $ARGV[0] =~ /configure/;
@ -16,10 +17,9 @@ system("depmod $version");
if (-d "/etc/kernel/postinst.d") { if (-d "/etc/kernel/postinst.d") {
print STDERR "Examining /etc/kernel/postinst.d.\n"; print STDERR "Examining /etc/kernel/postinst.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " . system(
"--arg=$imagedir/vmlinuz-$version " . "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postinst.d"
"/etc/kernel/postinst.d") && ) && die "Failed to process /etc/kernel/postinst.d";
die "Failed to process /etc/kernel/postinst.d";
} }
exit 0 exit 0

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl
use strict; use strict;
use warnings;
# Ignore all 'upgrade' invocations . # Ignore all 'upgrade' invocations .
exit 0 if $ARGV[0] =~ /upgrade/; exit 0 if $ARGV[0] =~ /upgrade/;
@ -11,10 +12,9 @@ my $version = "@@KVNAME@@";
if (-d "/etc/kernel/postrm.d") { if (-d "/etc/kernel/postrm.d") {
print STDERR "Examining /etc/kernel/postrm.d.\n"; print STDERR "Examining /etc/kernel/postrm.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " . system (
"--arg=$imagedir/vmlinuz-$version " . "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postrm.d"
"/etc/kernel/postrm.d") && ) && die "Failed to process /etc/kernel/postrm.d";
die "Failed to process /etc/kernel/postrm.d";
} }
unlink "$imagedir/initrd.img-$version"; unlink "$imagedir/initrd.img-$version";

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -w #!/usr/bin/perl
use strict; use strict;
use warnings;
# Ignore all invocations uxcept when called on to remove # Ignore all invocations uxcept when called on to remove
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ; exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ;
@ -14,10 +15,9 @@ my $version = "@@KVNAME@@";
if (-d "/etc/kernel/prerm.d") { if (-d "/etc/kernel/prerm.d") {
print STDERR "Examining /etc/kernel/prerm.d.\n"; print STDERR "Examining /etc/kernel/prerm.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " . system(
"--arg=$imagedir/vmlinuz-$version " . "run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/prerm.d"
"/etc/kernel/prerm.d") && ) && die "Failed to process /etc/kernel/prerm.d";
die "Failed to process /etc/kernel/prerm.d";
} }
exit 0 exit 0