Accepting request 448998 from home:michal-m:branches:Base:System

- purge-kernels: Handle kgraft patches (bsc#1017141)
  Cleanup unused code.

OBS-URL: https://build.opensuse.org/request/show/448998
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=278
This commit is contained in:
Marcus Meissner 2017-01-07 12:37:07 +00:00 committed by Git OBS Bridge
parent 54cd45711c
commit df723ad91e
3 changed files with 13 additions and 16 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 6 15:08:06 UTC 2017 - mmarek@suse.cz
- purge-kernels: Handle kgraft patches (bsc#1017141)
Cleanup unused code.
-------------------------------------------------------------------
Wed Dec 14 14:43:38 UTC 2016 - Thomas.Blume@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package dracut
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed

View File

@ -13,7 +13,6 @@ sub usage {
# arch/flavor => version-release => [ subpackages ]
my %kernels;
my %kmps;
my @keep_spec;
my ($want_running, $running_version, $running_flavor);
@ -72,19 +71,12 @@ sub load_config {
sub add_package {
my ($name, $vr, $arch) = @_;
my ($flavor, $table);
(my $flavor = $name) =~ s/^kernel-//;
#print STDERR "add_package: $name $vr $arch\n";
if ($name eq "kernel-firmware" || $name eq "kernel-coverage") {
return;
}
if ($name =~ /^kernel-/) {
($flavor = $name) =~ s/^kernel-//;
$table = \%kernels;
} elsif ($name =~ /-kmp-/) {
($flavor = $name) =~ s/.*-kmp-//;
$table = \%kmps;
}
# Put all subpackages into the same group, except for
# kernel-source-{vanilla,rt}, which are packages on their own
if ($flavor !~ /^source/) {
@ -92,9 +84,9 @@ sub add_package {
}
# kernel-devel is a subpackage of kernel-source
$flavor =~ s/^devel/source/;
$table->{"$arch/$flavor"} ||= {};
$table->{"$arch/$flavor"}{$vr} ||= [];
push(@{$table->{"$arch/$flavor"}{$vr}}, "$name-$vr.$arch");
$kernels{"$arch/$flavor"} ||= {};
$kernels{"$arch/$flavor"}{$vr} ||= [];
push(@{$kernels{"$arch/$flavor"}{$vr}}, "$name-$vr.$arch");
}
sub load_packages {
@ -104,8 +96,7 @@ sub load_packages {
open($pipe, '<', $fake_rpm_qa) or die "$fake_rpm_qa: $!\n";
} else {
open($pipe, '-|', 'rpm', '-qa', '--qf',
'%{n} %{v}-%{r} %{arch}\n', 'kernel-*', '*-kmp-*')
or die "rpm: $!\n";
'%{n} %{v}-%{r} %{arch}\n', 'kernel-*') or die "rpm: $!\n";
}
while (<$pipe>) {
chomp;
@ -309,7 +300,7 @@ sub remove_packages {
my %old_packages = map { $_ => 1 } @packages;
my %new_packages;
for (@out) {
if (/ is needed by \(installed\) (.*-kmp-.*)/ &&
if (/ is needed by \(installed\) (kgraft-patch-.*|.*-kmp-.*)/ &&
!$old_packages{$1}) {
push(@packages, $1) unless $new_packages{$1};
$new_packages{$1} = 1;