#!/usr/bin/perl -w #This Perl script reads in the output generated by executing the #gimp-procedural-db-dump function of GIMP and outputs a list of #the deprecated functions. # # Usage: # ./list-deprecated.pl < pdb.dump # #Kevin Cozens #April 10, 2006 # #Updated October 23, 2006 Kevin Cozens #Changed output_procedure_name to split on " character. This fixes the #parsing of the PDB dump created by a patched version 2.2 of GIMP. while (<>) { #We can't do anything until we locate the start of a register block if ($_ =~ /^.register-procedure/) { $line1 = $_; $line2 = <>; if ($line2 =~ /This procedure is deprecated!/) { print("\""); &output_procedure_name($line1); print("\", "); &output_new_procedure_name($line2); print("\n"); } } } exit; sub output_procedure_name { local (@words); @words = split(/\"/, "@_"); $words[1] =~ s/_/-/g; $words[1] =~ s/ [<]1[>]//; print("$words[1]"); } sub output_new_procedure_name { local (@words); if ("@_" !~ /[Uu]se/) { print("\"\""); } else { @words = split(/ /, "@_"); $words[7] =~ s/\'/\"/g; $words[7] =~ s/_/-/g; print("$words[7]"); } }