mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Bug 782784 - client.py update_nss and update_nspr should toggle the trailing whitespace line, r=glandium
This commit is contained in:
parent
8f5728f325
commit
f79eb1e9b0
17
client.py
17
client.py
@ -86,6 +86,21 @@ def do_cvs_export(modules, tag, cvsroot, cvs):
|
|||||||
cwd=os.path.join(topsrcdir, parent))
|
cwd=os.path.join(topsrcdir, parent))
|
||||||
print "CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
print "CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
||||||
|
|
||||||
|
def toggle_trailing_blank_line(depname):
|
||||||
|
"""If the trailing line is empty, then we'll delete it.
|
||||||
|
Otherwise we'll add a blank line."""
|
||||||
|
lines = open(depname, "r").readlines()
|
||||||
|
if not lines:
|
||||||
|
print >>sys.stderr, "unexpected short file"
|
||||||
|
return
|
||||||
|
|
||||||
|
if not lines[-1].strip():
|
||||||
|
# trailing line is blank, removing it
|
||||||
|
open(depname, "w").writelines(lines[:-1])
|
||||||
|
else:
|
||||||
|
# adding blank line
|
||||||
|
open(depname, "a").write("\n")
|
||||||
|
|
||||||
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname | update_webidlparser tagname")
|
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname | update_webidlparser tagname")
|
||||||
o.add_option("--skip-mozilla", dest="skip_mozilla",
|
o.add_option("--skip-mozilla", dest="skip_mozilla",
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
@ -114,6 +129,7 @@ elif action in ('update_nspr'):
|
|||||||
options.cvsroot = os.environ.get('CVSROOT', CVSROOT_MOZILLA)
|
options.cvsroot = os.environ.get('CVSROOT', CVSROOT_MOZILLA)
|
||||||
do_cvs_export(NSPR_DIRS, tag, options.cvsroot, options.cvs)
|
do_cvs_export(NSPR_DIRS, tag, options.cvsroot, options.cvs)
|
||||||
print >>file("nsprpub/TAG-INFO", "w"), tag
|
print >>file("nsprpub/TAG-INFO", "w"), tag
|
||||||
|
toggle_trailing_blank_line("nsprpub/config/prdepend.h")
|
||||||
elif action in ('update_nss'):
|
elif action in ('update_nss'):
|
||||||
tag, = args[1:]
|
tag, = args[1:]
|
||||||
if not options.cvsroot:
|
if not options.cvsroot:
|
||||||
@ -121,6 +137,7 @@ elif action in ('update_nss'):
|
|||||||
do_cvs_export(NSS_DIRS, tag, options.cvsroot, options.cvs)
|
do_cvs_export(NSS_DIRS, tag, options.cvsroot, options.cvs)
|
||||||
print >>file("security/nss/TAG-INFO", "w"), tag
|
print >>file("security/nss/TAG-INFO", "w"), tag
|
||||||
print >>file("security/nss/TAG-INFO-CKBI", "w"), tag
|
print >>file("security/nss/TAG-INFO-CKBI", "w"), tag
|
||||||
|
toggle_trailing_blank_line("security/coreconf/coreconf.dep")
|
||||||
elif action in ('update_nssckbi'):
|
elif action in ('update_nssckbi'):
|
||||||
tag, = args[1:]
|
tag, = args[1:]
|
||||||
if not options.cvsroot:
|
if not options.cvsroot:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user