OOO330
[LibreOffice.git] / solenv / bin / cwstouched.pl
blobeb306277580c9174cb9ccea184c52df8b9ba6ce1
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
5 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 # Copyright 2000, 2010 Oracle and/or its affiliates.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # This file is part of OpenOffice.org.
14 # OpenOffice.org is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU Lesser General Public License version 3
16 # only, as published by the Free Software Foundation.
18 # OpenOffice.org is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Lesser General Public License version 3 for more details
22 # (a copy is included in the LICENSE file that accompanied this code).
24 # You should have received a copy of the GNU Lesser General Public License
25 # version 3 along with OpenOffice.org. If not, see
26 # <http://www.openoffice.org/license.html>
27 # for a copy of the LGPLv3 License.
29 #***********************************************************************/
31 use strict;
32 use Cwd;
34 #### module lookup
35 my @lib_dirs;
36 BEGIN {
37 if ( !defined($ENV{SOLARENV}) ) {
38 die "No environment found (environment variable SOLARENV is undefined)";
40 push(@lib_dirs, "$ENV{SOLARENV}/bin/modules");
42 use lib (@lib_dirs);
44 use Cws;
46 # Prototypes
47 sub getMinor($);
48 sub getCwsWorkStamp();
50 my $workstamp = $ENV{'WORK_STAMP'};
51 my $solenv= $ENV{'SOLARENV'};
52 my $cwsWorkStamp = getCwsWorkStamp();
53 my $minor = getMinor($cwsWorkStamp);
55 my $oldWorkStamp = $workstamp."_".$minor;
56 my $svndiff="svn diff --summarize --old=svn://svn.services.openoffice.org/ooo/tags/".$oldWorkStamp." --new=svn://svn.services.openoffice.org/ooo/cws/".$cwsWorkStamp;
58 my @diff = `$svndiff`;
60 my @modules;
61 foreach(@diff)
63 if (/.*svn:\/\/svn.services.openoffice.org.*/)
65 $_ =~ /.*$oldWorkStamp\/(\w*)/;
66 my $newModule=$1;
67 if (defined($newModule))
69 if ( ! grep(/$newModule/,@modules))
71 push(@modules, $newModule);
78 foreach(@modules)
80 print "$_\n";
83 exit(0);
85 sub getMinor($)
87 my $workst = shift;
88 my $min="";
90 if ( ! defined($ENV{'UPDMINOR'}))
92 my $cws = Cws->new();
93 $cws->child($workst);
94 $cws->master($ENV{'WORK_STAMP'});
95 my $masterws = $cws->master();
96 my $childws = $cws->child();
98 # check if we got a valid child workspace
99 my $id = $cws->eis_id();
100 if ( !$id )
102 print("Child workspace '$childws' for master workspace '$masterws' not found in EIS database.\n");
103 exit(1);
106 my @milestones = $cws->milestone();
107 foreach (@milestones) {
108 if ( defined($_) )
110 $min=$_;
114 else
116 $min = $ENV{'UPDMINOR'};
119 chomp($min);
120 return $min;
123 sub getCwsWorkStamp()
125 my $cwsWorkSt="";
127 if ( ! defined($ENV{'CWS_WORK_STAMP'}))
129 my $currPath= cwd;
131 chdir($ENV{'SOLARENV'});
133 my @info = `svn info`;
135 foreach(@info)
137 if ( /URL:.*/ )
139 # URL: svn+ssh://svn@svn.services.openoffice.org/ooo/cws/qadev37/solenv
140 $_ = ~ /.*svn.services.openoffice.org(.*\/(.*))\/\w*/;
141 $cwsWorkSt=$2; #qadev37
146 else
148 $cwsWorkSt = $ENV{'CWS_WORK_STAMP'};
150 return $cwsWorkSt