]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
scripts/c2p: print some meta-info about the fixes before it is applied
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2026 09:12:04 +0000 (11:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2026 09:12:04 +0000 (11:12 +0200)
Makes things easier when applying to remember the state of.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/c2p

index ca3d8008909130de1fb7ce66d797496bcd78df1b..a41eae55874fff50d3be4cfde20ed343ecc79e8a 100755 (executable)
@@ -7,6 +7,8 @@
 # through the patch correctly :(
 #
 
+use Term::ANSIColor qw(:constants);
+
 my $base_id = "";
 my $line;
 my $firstline = "true";
@@ -121,7 +123,30 @@ chomp($new_file);
 system "mv $new_file ~/linux/stable/";
 #print "moved $new_file to ~/linux/stable/\n";
 
-print "cd ~/linux/stable && ./apply_it $new_file @ARGV\n";
+my @queued_in=`cd /home/gregkh/linux/stable/stable-queue/ && grep -l -r ${base_id} queue-* | sort -Vr`;
+foreach $queued_in (@queued_in) {
+       chomp($queued_in);
+       print " queued in: ", MAGENTA, "$queued_in\n", RESET;
+}
+
+my @lines=`git show ${base_id} | grep -i "fixes:" | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' '`;
+foreach $fix (@lines) {
+       chomp ($fix);
+       my $fix_id=`git log -1 --format="%H" "$fix"`;
+       if ($fix_id ne "") {
+               #print "fix_id=$fix_id";
+               my $release=`/home/gregkh/linux/vulns/tools/verhaal/id_found_in $fix_id`;
+               chomp($release);
+               my @r = split /\s+/, $release;
+               foreach $r (@r) {
+                       chomp($r);
+                       print " fixed in:       ", GREEN, "$r\n", RESET;
+               }
+       }
+}
+print "--------------------------------\n";
+
+#print "cd ~/linux/stable && ./apply_it $new_file @ARGV\n";
 system "cd ~/linux/stable && ./apply_it $new_file @ARGV";
 #system "cp ~/linux/stable/$new_file ~/linux/longterm";
 #system "cd ~/linux/longterm && ./apply_it $new_file";