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+"$@"}'
7 -$default_mws = 'SRC680';
8 +$default_mws = 'DEV300';
12 @@ -109,13 +109,20 @@ sub cws_add_modules($$$@)
13 print STDERR "Unable to open patch '$patch'.";
18 - if ( /^\+\+\+ ([^\/]*)/ ) {
19 + if ( /^--- ([^\/]*)/ ) {
22 + elsif ( /^\+\+\+ ([^\/]*)/ ) {
26 + elsif ( $minus_name ne "" ) {
27 + $modules{$minus_name} = "add";
30 - print STDERR "Unable to guess module name ($1) from $patch.\n";
31 + print STDERR "Unable to guess module name from $patch.\n";
35 @@ -183,10 +190,10 @@ sub apply_patches(@)
40 +sub cvs_add_rm_files(@)
43 - system( "echo '===== cvs_add_files =====' >> .log" );
44 + system( "echo '===== cvs_add_rm_files =====' >> .log" );
48 @@ -195,30 +202,48 @@ sub cvs_add_files(@)
49 print STDERR "Unable to open patch '$patch'.";
56 - if ( /^\+\+\+ ([^\s]*)/ ) {
57 + if ( /^--- ([^\s]*)/ ) {
62 + elsif ( /^\+\+\+ ([^\s]*)/ ) {
68 + elsif ( /^\@\@ .* \+0,0 \@\@$/ && $file_rm ne "" ) {
69 + if ( $file_rm =~ /^([^\/]+)\/(.*)/ ) {
73 + if ( system( "cd $dir && cvs rm $file" ) != 0 ) {
74 + print STDERR "Unable to exec 'cd $dir && cvs rm $file'.\n";
80 elsif ( /^\@\@ -0,0 / && $file_add ne "" ) {
81 - my @to_add = split( /\//, $file_add );
83 - for my $add ( @to_add ) {
84 - $current .= "/" unless ( $current eq "" );
85 - my $where_add_dir = $current;
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";
97 + my @to_add = split( /\//, $file_add );
99 + for my $add ( @to_add ) {
100 + $current .= "/" unless ( $current eq "" );
101 + my $where_add_dir = $current;
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";
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/[^/]*$##;
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";
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" ) {