3 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 # Copyright 2008 by Sun Microsystems, Inc.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # This file is part of OpenOffice.org.
12 # OpenOffice.org is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Lesser General Public License version 3
14 # only, as published by the Free Software Foundation.
16 # OpenOffice.org is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Lesser General Public License version 3 for more details
20 # (a copy is included in the LICENSE file that accompanied this code).
22 # You should have received a copy of the GNU Lesser General Public License
23 # version 3 along with OpenOffice.org. If not, see
24 # <http://www.openoffice.org/license.html>
25 # for a copy of the LGPLv3 License.
26 #***********************************************************************/
34 currPath
= sys
.path
[0] or os
.getcwd()
35 currPath
= path
.abspath(currPath
)
38 def getCwsWorkStamp():
39 cwsWorkStamp
=os
.getenv('CWS_WORK_STAMP')
42 currPath
=getCurrPath()
44 os
.chdir(os
.getenv('SOLARENV'))
46 (input, output
) = os
.popen4("svn info")
48 for outline
in output
.readlines():
49 if outline
.startswith("URL:"):
50 cwsWorkStamp
= outline
[outline
.index("svn.services"):outline
.index("solenv")-1]
51 cwsWorkStamp
= cwsWorkStamp
[cwsWorkStamp
.rfind("/")+1:len(cwsWorkStamp
)]
54 os
.putenv("CWS_WORK_STAMP",cwsWorkStamp
);
57 return string
.strip(cwsWorkStamp
)
59 def getMinor(cwsWorkStamp
):
60 minor
= os
.getenv('UPDMINOR')
63 if (os
.getenv('OSTYPE') == "cygwin"):
64 bash
=os
.getenv("SHELL")
65 (input, output
) = os
.popen4("cygpath -w "+bash
)
66 winbash
=string
.strip(output
.readlines()[0])
67 cws
=winbash
+" -c 'cws query -c "+cwsWorkStamp
+" current'"
69 cws
="cws query -c "+cwsWorkStamp
+" current"
71 (input, output
) = os
.popen4(cws
)
74 for outline
in output
.readlines():
78 elif outline
.find("Current milestone:") != -1:
81 return string
.strip(minor
)
84 workstamp
= os
.getenv('WORK_STAMP')
85 solenv
= os
.getenv('SOLARENV')
86 cwsWorkStamp
=getCwsWorkStamp()
87 minor
= getMinor(cwsWorkStamp
)
89 oldWorkStamp
= workstamp
+ "_" + minor
90 diff
="svn diff --summarize --old=svn://svn.services.openoffice.org/ooo/tags/"+oldWorkStamp
+" --new=svn://svn.services.openoffice.org/ooo/cws/"+cwsWorkStamp
93 (input, output
) = os
.popen4(diff
)
95 for outline
in output
.readlines():
96 if outline
.find("svn://svn.services.openoffice.org"):
97 index
= outline
.index(oldWorkStamp
)+len(oldWorkStamp
)+1
99 if outline
.find("/",index
) != -1:
101 newModule
=string
.strip(outline
[index
:outline
.index("/",index
)])
103 #seems to be a folder
104 if len(outline
[index
:]) > 0:
105 newModule
=string
.strip(outline
[index
:])
106 if newModule
!= "" and not modules
.count(newModule
):
107 modules
.append(newModule
)
109 for module
in modules
: