From 34554065f9d359e06fa0cc8d8d606a715575ccad Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 24 Jan 2020 12:09:30 +0100 Subject: [PATCH] pdist Fix excludes for running kernel With commit baec330439b6b8c8d47aa368623c68098d935da0 ("pdist: Do not delete running kernel") the removal of the files needed by the running kernel was prevented by adding the relevant drectories to the EXCEPTS array. This worked, however it also prevent pdist from updating delivering any files into the excluded directories, e.g. after an incomplete install by mariuxinstaller. Do not prevent installs and updates of the directories used by the running kernel. Do prevent their removal only. --- pdist/pdist | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pdist/pdist b/pdist/pdist index 429bb6a..f474963 100755 --- a/pdist/pdist +++ b/pdist/pdist @@ -651,20 +651,6 @@ sub prog_update local($, , $\)=(' ',"\n"); - if ($function == F_UPDATE) { - chomp (my $linux_version=`uname -r`); # '5.4.0-rc2.mx64.295' - if ($linux_version) { - my ($build) = $linux_version =~ /\.(\d+)$/; - push @EXCEPTS, - "/boot/mariux.$build", - "/boot/bzImage-$linux_version", - "/lib/modules/$linux_version", - "/boot/config-$linux_version", - "/boot/System.map-$linux_version", - "/usr/share/nvidia/kernel/$linux_version", - } - } - if ($tarfile && $tarfile ne '-') { -d $TMPDIR or mkdir $TMPDIR or die $TMPDIR.": $!\n"; if (-d $TMPUPDDIR) { @@ -796,7 +782,21 @@ sub prog_update if ($function==F_UPDATE) { if ($delete) { + my %except; + chomp (my $linux_version=`uname -r`); # '5.4.0-rc2.mx64.295' + if ($linux_version) { + my ($build) = $linux_version =~ /\.(\d+)$/; + %except=map {$_=>1} ( + "/boot/mariux.$build", + "/boot/bzImage-$linux_version", + "/lib/modules/$linux_version", + "/boot/config-$linux_version", + "/boot/System.map-$linux_version", + "/usr/share/nvidia/kernel/$linux_version", + ) + } for my $path (keys %CLEAN) { + $except{$path} and next; lstat $path or die "$path: $!\n"; if (-e _) { if (-d _) {