toolkit/xre/make-platformini.py
author Benjamin Smedberg <benjamin@smedbergs.us>
Thu, 20 Mar 2008 12:42:05 -0400
changeset 13381 895712d07d4c3e0642195ba453446181ddd7a65c
parent 10257 2630a67dc51be324ca2efb83198f4ce85caa208a
child 16490 e9f69e5e5a41f48042f1482d91c0f17b587f8774
permissions -rw-r--r--
Merge cvs-trunk-mirror -> mozilla-central. There's a C++ bug in js/src/jsinterp.cpp that I am going to file upstream.

#!/usr/bin/python

from optparse import OptionParser
from datetime import datetime
import sys
import os

o = OptionParser()
o.add_option("--buildid", dest="buildid")
o.add_option("--print-buildid", action="store_true", dest="print_buildid")

(options, args) = o.parse_args()

if options.print_buildid:
    print datetime.now().strftime('%Y%m%d%H')
    sys.exit(0)

if not options.buildid:
    print >>sys.stderr, "--buildid is required"
    sys.exit(1)

(milestoneFile,) = args
for line in open(milestoneFile, 'r'):
    if line[0] == '#':
        continue

    line = line.strip()
    if line == '':
        continue

    milestone = line

print """[Build]
BuildID=%s
Milestone=%s""" % (options.buildid, milestone)