2
# This Source Code Form is subject to the terms of the Mozilla Public
3
# License, v. 2.0. If a copy of the MPL was not distributed with this
4
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
from optparse import OptionParser
8
from datetime import datetime
13
o.add_option("--buildid", dest="buildid")
14
o.add_option("--print-buildid", action="store_true", dest="print_buildid")
15
o.add_option("--sourcestamp", dest="sourcestamp")
16
o.add_option("--sourcerepo", dest="sourcerepo")
18
(options, args) = o.parse_args()
20
if options.print_buildid:
21
print datetime.now().strftime('%Y%m%d%H%M%S')
24
if not options.buildid:
25
print >>sys.stderr, "--buildid is required"
28
(milestoneFile,) = args
29
for line in open(milestoneFile, 'r'):
41
Milestone=%s""" % (options.buildid, milestone)
42
if options.sourcestamp:
43
print "SourceStamp=%s" % options.sourcestamp
44
if options.sourcerepo:
45
print "SourceRepository=%s" % options.sourcerepo