From: Greg Kroah-Hartman Date: Tue, 21 Jul 2026 09:12:04 +0000 (+0200) Subject: scripts/c2p: print some meta-info about the fixes before it is applied X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=15fe24cdffd48ba85926a307a7d483d812d27145;p=thirdparty%2Fkernel%2Fstable-queue.git scripts/c2p: print some meta-info about the fixes before it is applied Makes things easier when applying to remember the state of. Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/c2p b/scripts/c2p index ca3d800890..a41eae5587 100755 --- a/scripts/c2p +++ b/scripts/c2p @@ -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";