summaryrefslogtreecommitdiffstats
path: root/kresources/groupwise/soap/fixup_groupwise.h.pl
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kresources/groupwise/soap/fixup_groupwise.h.pl
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/groupwise/soap/fixup_groupwise.h.pl')
-rwxr-xr-xkresources/groupwise/soap/fixup_groupwise.h.pl60
1 files changed, 60 insertions, 0 deletions
diff --git a/kresources/groupwise/soap/fixup_groupwise.h.pl b/kresources/groupwise/soap/fixup_groupwise.h.pl
new file mode 100755
index 000000000..938811179
--- /dev/null
+++ b/kresources/groupwise/soap/fixup_groupwise.h.pl
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $inplace;
+
+if ( @ARGV == 1 && $ARGV[ 0 ] == "--inplace" ) {
+ print "Substituting in place.\n";
+ $inplace = 1;
+}
+
+my $fileIn = "groupwise.h";
+my $fileOut = "$fileIn.fixed";
+my $fileBack = "$fileIn.backup";
+
+if ( !open IN, $fileIn ) {
+ print STDERR "Unable to open '$fileIn'.\n";
+ exit 1;
+}
+
+if ( !open OUT, ">$fileOut" ) {
+ print STDERR "Unable to open '$fileOut'.\n";
+ exit 1;
+}
+
+while ( <IN> ) {
+ my $newline;
+
+ if ( /^(.*)ns1__(\w+\s+0?;.*)$/ ) {
+# print;
+ $newline = $1 . $2 . "\n";
+# print $newline;
+ $_ = $newline;
+ }
+
+if ( 0 ) {
+ if ( /(^\s+\S+\s+)ns1__(.*)/ ) {
+ $newline = $1 . $2 . "\n";
+ if ( !/enum/ && /element$/) {
+# print;
+# print $newline;
+ $_ = $newline;
+ }
+ } elsif ( /(^\s+unsigned long\*\s+)ns1__(.*)/ ) {
+ $newline = $1 . $2 . "\n";
+# print $newline;
+ $_ = $newline;
+ } elsif ( /(^\s+std\:\:\S+\s+\>.*)ns1__(.*)/ ) {
+ $newline = $1 . $2 . "\n";
+ $_ = $newline;
+ }
+}
+
+ print OUT;
+}
+
+if ( $inplace ) {
+ system( "mv $fileIn $fileBack" );
+ system( "mv $fileOut $fileIn" );
+}