File: adapt-to-new-kdebug-api.pl

package info (click to toggle)
kde-dev-scripts 4%3A18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,496 kB
  • sloc: perl: 15,466; lisp: 5,627; sh: 4,157; python: 3,892; ruby: 2,158; makefile: 16; sed: 9
file content (35 lines) | stat: -rwxr-xr-x 873 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

# Laurent Montel <montel@kde.org> 2007 GPL
# This script ports everything in the current directory (and recursively) to the Qt4 API,
# for things that can be done automatically.
# This script must be launch after that kdDebug was convert to kDebug etc.

use File::Basename;
use lib dirname( $0 );
use functionUtilkde;
use strict;

open(my $F, "-|", qw(find . -type f));
my $file;
my $warning;
my @files = ();
while ($file = <$F>) {
    chomp $file;
    next if functionUtilkde::excludeFile( $file);
    if (functionUtilkde::substInFile {

	if( $_ =~ /kDebug/ ) {
		s!\s*\<\<\s*endl\s*;!;!;
	}
        if( $_ =~ /kWarning/ ) {
		s!\s*\<\<\s*endl\s*;!;!;
        }
        if( $_ =~ /kFatal/ ) {
		s!\s*\<\<\s*endl\s*;!;!;
        }

    } $file) { push(@files,$file); }
}
functionUtilkde::diffFile( @files );
warn "Warning: $warning\n" if ($warning != "");