update ooo310-m15
[ooovba.git] / applied_patches / 0032-cws-commit-patch-default-dev300.diff
blob0f606b717aba586a6b66ba65b86b8a9487dc53ab
1 --- solenv/bin/cws-commit-patch 2006-12-01 17:23:55.000000000 +0100
2 +++ solenv/bin/cws-commit-patch 2008-03-25 18:49:02.000000000 +0100
3 @@ -38,7 +38,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
5 use Cwd 'abs_path';
7 -$default_mws = 'SRC680';
8 +$default_mws = 'DEV300';
10 sub usage()
12 @@ -109,13 +109,20 @@ sub cws_add_modules($$$@)
13 print STDERR "Unable to open patch '$patch'.";
14 exit 1;
16 + my $minus_name;
17 while (<$PATCH>) {
18 - if ( /^\+\+\+ ([^\/]*)/ ) {
19 + if ( /^--- ([^\/]*)/ ) {
20 + $minus_name = $1;
21 + }
22 + elsif ( /^\+\+\+ ([^\/]*)/ ) {
23 if ( $1 ne "" ) {
24 $modules{$1} = "add";
26 + elsif ( $minus_name ne "" ) {
27 + $modules{$minus_name} = "add";
28 + }
29 else {
30 - print STDERR "Unable to guess module name ($1) from $patch.\n";
31 + print STDERR "Unable to guess module name from $patch.\n";
32 close( $PATCH );
33 exit 1;
35 @@ -183,10 +190,10 @@ sub apply_patches(@)
39 -sub cvs_add_files(@)
40 +sub cvs_add_rm_files(@)
42 my ( @patches ) = @_;
43 - system( "echo '===== cvs_add_files =====' >> .log" );
44 + system( "echo '===== cvs_add_rm_files =====' >> .log" );
46 my %modules = ();
48 @@ -195,30 +202,48 @@ sub cvs_add_files(@)
49 print STDERR "Unable to open patch '$patch'.";
50 exit 1;
52 - my $file_add = "";
53 + my $file_add = "";
54 + my $file_rm = "";
55 while (<$PATCH>) {
56 - if ( /^\+\+\+ ([^\s]*)/ ) {
57 + if ( /^--- ([^\s]*)/ ) {
58 + if ( $1 ne "" ) {
59 + $file_rm = $1;
60 + }
61 + }
62 + elsif ( /^\+\+\+ ([^\s]*)/ ) {
63 if ( $1 ne "" ) {
64 - $file_add = $1;
65 + $file_add = $1;
66 + }
67 + }
68 + elsif ( /^\@\@ .* \+0,0 \@\@$/ && $file_rm ne "" ) {
69 + if ( $file_rm =~ /^([^\/]+)\/(.*)/ ) {
70 + my $dir = $1;
71 + my $file = $2;
73 + if ( system( "cd $dir && cvs rm $file" ) != 0 ) {
74 + print STDERR "Unable to exec 'cd $dir && cvs rm $file'.\n";
75 + close( $PATCH );
76 + exit 1;
77 + }
80 elsif ( /^\@\@ -0,0 / && $file_add ne "" ) {
81 - my @to_add = split( /\//, $file_add );
82 - my $current = "";
83 - for my $add ( @to_add ) {
84 - $current .= "/" unless ( $current eq "" );
85 - my $where_add_dir = $current;
86 - $current .= $add;
88 - if ( ( -d "$current" && ! -d "$current/CVS" ) || ( -f "$current" ) ) {
89 - if ( system( "cd $where_add_dir && cvs add $add" ) != 0 ) {
90 - print STDERR "Unable to exec 'cd $where_add_dir && cvs add $add'.\n";
91 - close( $PATCH );
92 - exit 1;
93 - }
94 - }
95 - }
96 - }
97 + my @to_add = split( /\//, $file_add );
98 + my $current = "";
99 + for my $add ( @to_add ) {
100 + $current .= "/" unless ( $current eq "" );
101 + my $where_add_dir = $current;
102 + $current .= $add;
104 + if ( ( -d "$current" && ! -d "$current/CVS" ) || ( -f "$current" ) ) {
105 + if ( system( "cd $where_add_dir && cvs add $add" ) != 0 ) {
106 + print STDERR "Unable to exec 'cd $where_add_dir && cvs add $add'.\n";
107 + close( $PATCH );
108 + exit 1;
114 close( $PATCH );
116 @@ -234,7 +259,7 @@ sub cws_commit($$$$$@)
118 apply_patches( @patches );
120 - cvs_add_files( @patches );
121 + cvs_add_rm_files( @patches );
123 my @cws_modules = cws_modules( $mws, $cws );
124 my $commit_message = "#i$iz#\n" . $summary;
125 @@ -261,10 +286,10 @@ if ( !defined( $ENV{'SOLARENV'} ) || $EN
126 $build_dir =~ s#/solenv/bin/[^/]*$##;
127 my $env_script = "";
128 if ( -f "$build_dir/LinuxIntelEnv.Set.sh" ) {
129 - $env_script = "$build_dir/LinuxIntelEnv.Set.sh";
130 + $env_script = "$build_dir/LinuxIntelEnv.Set.sh";
132 elsif ( -f "$build_dir/LinuxX86-64Env.Set.sh" ) {
133 - $env_script = "$build_dir/LinuxX86-64Env.Set.sh";
134 + $env_script = "$build_dir/LinuxX86-64Env.Set.sh";
136 else {
137 print STDERR "Unable to find '$build_dir/Linux(Intel|X86-64)Env.Set.sh'.\n";
138 @@ -312,10 +337,10 @@ while (@ARGV) {
140 elsif ( $opt eq "-m" || $opt eq "--milestone" ) {
141 $milestone = shift @ARGV;
142 - if (! ( $milestone =~ m/^m/ ) ) {
143 - $milestone = "m$milestone";
144 - print "Re-writing milestone to $milestone\n";
146 + if (! ( $milestone =~ m/^m/ ) ) {
147 + $milestone = "m$milestone";
148 + print "Re-writing milestone to $milestone\n";
151 elsif ( $opt eq "-w" || $opt eq "--mws" ) {
152 $mws = shift @ARGV;