52 from optparse
import OptionParser
53 parser = OptionParser()
54 parser.add_option(
"--pre", action =
"store_true",
55 help =
"Create -pre tags instead of final tags.")
56 parser.add_option(
"-b",
"--branch",
57 help =
"Use the given (global) branch as source for the tags instead of the trunk")
58 opts, args = parser.parse_args()
60 opts.branch =
"/".join([
"branches",
"GAUDI", opts.branch])
64 url =
"svn+ssh://svn.cern.ch/reps/gaudi"
66 container =
"GaudiRelease"
67 project_info = ConfigParser()
68 project_info.optionxform = str
69 project_info.read(
'project.info')
70 packages = dict(project_info.items(
'Packages'))
71 tempdir = tempfile.mkdtemp()
78 pvers =
"%s_%s" % (proj.upper(), packages[container])
81 ptagdir =
"%s/tags/%s/%s" % (proj, proj.upper(), pvers)
83 svn(
'cp',
'/'.join([proj, opts.branch]), ptagdir).wait()
86 tag_re = re.compile(
r"^v(\d+)r(\d+)(?:p(\d+))?$")
89 pktagdir =
"%s/tags/%s/%s" % (proj, p, tag)
93 make_tag = no_tag
or (opts.pre
and no_tag
and not svn_exists(pktagdir +
"-pre"))
97 svn(
"cp",
"/".join([proj, opts.branch, p]), pktagdir).wait()
99 tagElements = tag_re.match(tag)
101 tagElements =
"-".join([
"%02d" % int(el
or "0")
for el
in tagElements.groups() ])
102 pktagdir =
"%s/tags/%s/%s-%s" % (proj, p, p, tagElements)
103 svn(
"cp",
"/".join([proj, opts.branch, p]), pktagdir).wait()
106 svn(
"up",
"--depth=empty", pktagdir).wait()
111 shutil.rmtree(tempdir, ignore_errors =
True)