3 from __future__
import print_function
4 from optparse
import OptionParser
10 'juh': 'javaunohelper',
15 'unoloader': 'ridljar',
18 parser
= OptionParser()
19 _
, args
= parser
.parse_args()
22 parser
.error('not enough arguments')
24 parser
.error('too many arguments')
26 DEST
= r
'\g<1>%s\g<3>' % args
[0]
29 def replace_in_file(filename
, src_pattern
):
31 f
= open(filename
, "r")
34 s
= re
.sub(src_pattern
, DEST
, s
)
35 f
= open(filename
, "w")
38 except IOError as err
:
39 print('error updating %s: %s' % (filename
, err
), file=sys
.stderr
)
41 src_pattern
= re
.compile(r
'^(\s*<version>)([-.@\w]+)(</version>\s*)$',
44 for a
in ['juh', 'jurt', 'officebean', 'ridl', 'unoil', 'unoloader']:
45 replace_in_file(os
.path
.join(M
[a
], 'pom.%s.xml' % a
), src_pattern
)
47 src_pattern
= re
.compile(r
"^(LIBREOFFICE_VERSION = ')([-.@\w]+)(')$",
49 replace_in_file('solenv/maven/VERSION', src_pattern
)