Permalink
Browse files

"Any programmer who fails to comply with the standard naming, formatt…

…ing,

or commenting conventions should be shot.  If it so happens that it is
inconvenient to shoot him, then he is to be politely requested to recode
his program in adherence to the above standard."
		-- Michael Spier, Digital Equipment Corporation

svn path=/branches/tk705/; revision=6152
  • Loading branch information...
sraustein committed Oct 26, 2015
1 parent 397beaf commit b46deb1417dc3596e9ac9fe2fe8cc0b7f42457e7
Showing with 21,376 additions and 21,373 deletions.
  1. +63 −63 buildtools/build-freebsd-ports.py
  2. +2 −2 buildtools/build-ubuntu-ports.py
  3. +13 −13 buildtools/defstack.py
  4. +2 −2 buildtools/make-rcynic-script.py
  5. +7 −7 buildtools/make-relaxng.py
  6. +9 −9 buildtools/make-sql-schemas.py
  7. +19 −19 buildtools/make-version.py
  8. +94 −94 buildtools/pull-doc-from-wiki.py
  9. +1 −1 buildtools/pylint.rc
  10. +12 −12 buildtools/rpki-pbuilder.py
  11. +211 −211 ca/irbe_cli
  12. +2 −2 ca/irdbd
  13. +2 −2 ca/pubd
  14. +2 −2 ca/rootd
  15. +230 −225 ca/rpki-confgen
  16. +7 −7 ca/rpki-sql-backup
  17. +189 −189 ca/rpki-sql-setup
  18. +18 −18 ca/rpki-start-servers
  19. +2 −2 ca/rpkic
  20. +2 −2 ca/rpkid
  21. +336 −336 ca/rpkigui-apache-conf-gen
  22. +0 −1 ca/rpkigui-import-routes
  23. +28 −28 ca/tests/bgpsec-yaml.py
  24. +37 −37 ca/tests/myrpki-xml-parse-test.py
  25. +2 −2 ca/tests/old_irdbd.py
  26. +1,098 −1,098 ca/tests/smoketest.py
  27. +16 −16 ca/tests/sql-cleaner.py
  28. +10 −10 ca/tests/sql-dumper.py
  29. +57 −57 ca/tests/test-rrdp.py
  30. +59 −59 ca/tests/testpoke.py
  31. +54 −54 ca/tests/xml-parse-test.py
  32. +713 −713 ca/tests/yamlconf.py
  33. +803 −803 ca/tests/yamltest.py
  34. +214 −214 potpourri/analyze-rcynic-history.py
  35. +51 −51 potpourri/analyze-transition.py
  36. +19 −19 potpourri/apnic-to-csv.py
  37. +32 −32 potpourri/arin-to-csv.py
  38. +10 −10 potpourri/cross_certify.py
  39. +28 −28 potpourri/csvgrep.py
  40. +38 −38 potpourri/expand-roa-prefixes.py
  41. +9 −9 potpourri/extract-key.py
  42. +5 −6 potpourri/fakerootd.py
  43. +63 −63 potpourri/format-application-x-rpki.py
  44. +79 −79 potpourri/gc_summary.py
  45. +16 −16 potpourri/generate-ripe-root-cert.py
  46. +2 −2 potpourri/gski.py
  47. +18 −18 potpourri/guess-roas-from-routeviews.py
  48. +28 −28 potpourri/iana-to-csv.py
  49. +16 −16 potpourri/missing-oids.py
  50. +19 −19 potpourri/object-dates.py
  51. +1 −1 potpourri/print-profile.py
  52. +75 −75 potpourri/rcynic-diff.py
  53. +66 −66 potpourri/ripe-asns-to-csv.py
  54. +77 −77 potpourri/ripe-to-csv.py
  55. +118 −118 potpourri/roa-to-irr.py
  56. +144 −144 potpourri/rrd-rcynic-history.py
  57. +14 −14 potpourri/rrdp-fetch.py
  58. +30 −30 potpourri/show-key-identifiers.py
  59. +9 −9 potpourri/show-tracking-data.py
  60. +13 −13 potpourri/signed-object-dates.py
  61. +7 −7 potpourri/testbed-rootcert.py
  62. +9 −9 potpourri/translate-handles.py
  63. +16 −16 potpourri/upgrade-add-ghostbusters.py
  64. +166 −167 potpourri/validation-status-sql.py
  65. +23 −23 potpourri/whack-ripe-asns.py
  66. +33 −33 potpourri/whack-ripe-prefixes.py
  67. +78 −78 potpourri/x509-dot.py
  68. +45 −45 rp/rcynic/rcynic-cron
  69. +466 −466 rp/rcynic/rcynic-html
  70. +53 −53 rp/rcynic/rcynic-svn
  71. +72 −72 rp/rcynic/rcynic-text
  72. +583 −583 rp/rcynic/rpki-torrent.py
  73. +8 −8 rp/rcynic/validation_status
  74. +2 −2 rp/rpki-rtr/rpki-rtr
  75. +101 −101 rp/utils/find_roa
  76. +25 −25 rp/utils/hashdir
  77. +35 −35 rp/utils/print_roa
  78. +17 −17 rp/utils/print_rpki_manifest
  79. +22 −22 rp/utils/scan_roas
  80. +14 −14 rp/utils/scan_routercerts
  81. +35 −35 rp/utils/uri
  82. +297 −297 rpki/adns.py
  83. +201 −201 rpki/cli.py
  84. +206 −206 rpki/config.py
  85. +78 −78 rpki/csv_utils.py
  86. +44 −44 rpki/daemonize.py
  87. +1 −1 rpki/django_settings/common.py
  88. +77 −77 rpki/exceptions.py
  89. +102 −102 rpki/fields.py
  90. +99 −99 rpki/gui/app/forms.py
  91. +39 −39 rpki/gui/app/views.py
  92. +0 −1 rpki/gui/cacheview/tests.py
  93. +75 −75 rpki/http_simple.py
  94. +71 −71 rpki/ipaddrs.py
  95. +352 −352 rpki/irdb/models.py
  96. +64 −64 rpki/irdb/router.py
  97. +1,474 −1,471 rpki/irdb/zookeeper.py
  98. +180 −180 rpki/irdbd.py
  99. +5 −5 rpki/left_right.py
  100. +186 −186 rpki/log.py
  101. +2 −2 rpki/myrpki.py
  102. +4 −4 rpki/mysql_import.py
  103. +11 −11 rpki/oids.py
  104. +243 −243 rpki/old_irdbd.py
  105. +242 −242 rpki/pubd.py
  106. +238 −238 rpki/pubdb/models.py
  107. +27 −27 rpki/publication.py
  108. +21 −21 rpki/publication_control.py
  109. +217 −217 rpki/rcynic.py
  110. +38 −38 rpki/relaxng.py
  111. +16 −16 rpki/relaxng_parser.py
  112. +984 −984 rpki/resource_set.py
  113. +405 −405 rpki/rootd.py
  114. +716 −717 rpki/rpkic.py
  115. +609 −609 rpki/rpkid.py
  116. +456 −456 rpki/rpkid_tasks.py
  117. +2,030 −2,030 rpki/rpkidb/models.py
  118. +241 −241 rpki/rtr/bgpdump.py
  119. +182 −182 rpki/rtr/channels.py
  120. +408 −408 rpki/rtr/client.py
  121. +474 −474 rpki/rtr/generator.py
  122. +55 −55 rpki/rtr/main.py
  123. +480 −480 rpki/rtr/pdus.py
  124. +436 −436 rpki/rtr/server.py
  125. +228 −228 rpki/sundial.py
  126. +70 −70 rpki/up_down.py
  127. +1,737 −1,737 rpki/x509.py
  128. +86 −86 setup.py
  129. +65 −65 setup_extensions.py
@@ -2,11 +2,11 @@
#
# Copyright (C) 2014 Dragon Research Labs ("DRL")
# Portions copyright (C) 2012-2013 Internet Systems Consortium ("ISC")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notices and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND DRL AND ISC DISCLAIM ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DRL OR
@@ -33,9 +33,9 @@
import subprocess
def check_dir(s):
if not os.path.isdir(s):
raise argparse.ArgumentTypeError("%r is not a directory" % s)
return s
if not os.path.isdir(s):
raise argparse.ArgumentTypeError("%r is not a directory" % s)
return s
parser = argparse.ArgumentParser(description = __doc__,
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
@@ -57,15 +57,15 @@ def check_dir(s):
svnversion = subprocess.check_output(("svnversion", "-c", args.svndir)).strip().split(":")[-1]
if args.local_dist:
svnversion = svnversion.translate(None, "M")
svnversion = svnversion.translate(None, "M")
if not svnversion.isdigit():
sys.exit("Sources don't look pristine, not building (%r)" % svnversion)
sys.exit("Sources don't look pristine, not building (%r)" % svnversion)
branch = os.path.basename(args.svndir.rstrip(os.path.sep))
if branch != "trunk" and (branch[:2] != "tk" or not branch[2:].isdigit()):
sys.exit("Could not parse branch from working directory name, not building (%r)" % branch)
sys.exit("Could not parse branch from working directory name, not building (%r)" % branch)
version = "0." + svnversion
tarname = "rpki-%s-r%s" % (branch, svnversion)
@@ -74,83 +74,83 @@ def check_dir(s):
portsdir_old = args.portsdir + ".old"
if os.path.isdir(portsdir_old):
shutil.rmtree(portsdir_old)
shutil.rmtree(portsdir_old)
if os.path.isdir(args.portsdir):
os.rename(args.portsdir, portsdir_old)
os.rename(args.portsdir, portsdir_old)
shutil.copytree(os.path.join(args.svndir, "buildtools", "freebsd-skeleton"), args.portsdir)
if args.local_dist:
subprocess.check_call(("svn", "export", args.svndir, os.path.join(args.portsdir, tarname)))
for fn, fmt in (("VERSION", "%s\n"), ("rpki/version.py", "VERSION = \"%s\"\n")):
with open(os.path.join(args.portsdir, tarname, fn), "w") as f:
f.write(fmt % version)
subprocess.check_call(("tar", "cJvvf", tarball, tarname), cwd = args.portsdir)
shutil.rmtree(os.path.join(args.portsdir, tarname))
subprocess.check_call(("svn", "export", args.svndir, os.path.join(args.portsdir, tarname)))
for fn, fmt in (("VERSION", "%s\n"), ("rpki/version.py", "VERSION = \"%s\"\n")):
with open(os.path.join(args.portsdir, tarname, fn), "w") as f:
f.write(fmt % version)
subprocess.check_call(("tar", "cJvvf", tarball, tarname), cwd = args.portsdir)
shutil.rmtree(os.path.join(args.portsdir, tarname))
elif os.path.exists(os.path.join(portsdir_old, tarball)):
os.link(os.path.join(portsdir_old, tarball), os.path.join(args.portsdir, tarball))
os.link(os.path.join(portsdir_old, tarball), os.path.join(args.portsdir, tarball))
elif os.path.exists(os.path.join("/usr/ports/distfiles", tarball)):
shutil.copy(os.path.join("/usr/ports/distfiles", tarball), os.path.join(args.portsdir, tarball))
shutil.copy(os.path.join("/usr/ports/distfiles", tarball), os.path.join(args.portsdir, tarball))
if os.path.isdir(portsdir_old):
shutil.rmtree(portsdir_old)
shutil.rmtree(portsdir_old)
if args.make_package or args.local_dist:
pkgdir = os.path.join(args.portsdir, "packages")
os.mkdir(pkgdir)
pkgdir = os.path.join(args.portsdir, "packages")
os.mkdir(pkgdir)
py_lib = re.compile(r"^lib/python\d+\.\d+")
py_sitelib = re.compile(r"^lib/python\d+\.\d+/site-packages")
if args.local_dist:
master_site = "file://" + args.portsdir + "/"
master_site = "file://" + args.portsdir + "/"
else:
master_site = "http://download.rpki.net/"
master_site = "http://download.rpki.net/"
formatdict = dict(SVNVERSION = svnversion, SVNBRANCH = branch, MASTER_SITE = master_site)
keepdirs = ("usr", "etc", "bin", "var", "lib", "libexec", "sbin", "share", "etc/rc.d", "%%PYTHON_SITELIBDIR%%")
for port in ("rpki-rp", "rpki-ca"):
base = os.path.join(args.portsdir, port)
stage = os.path.join(base, "work", "stage")
fn = os.path.join(args.portsdir, port, "Makefile")
with open(fn, "r") as f:
template = f.read()
with open(fn, "w") as f:
f.write(template % formatdict)
subprocess.check_call(("make", "makesum", "stage", "DISTDIR=" + args.portsdir, "NO_DEPENDS=yes"),
cwd = base)
with open(os.path.join(base, "pkg-plist"), "w") as f:
usr_local = None
for dirpath, dirnames, filenames in os.walk(stage, topdown = False):
dn = dirpath[len(stage)+1:]
if dn.startswith("usr/local"):
if not usr_local and usr_local is not None:
f.write("@cwd\n")
usr_local = True
dn = dn[len("usr/local/"):]
dn = py_sitelib.sub("%%PYTHON_SITELIBDIR%%", dn)
if dn == "etc/rc.d":
continue
else:
if usr_local:
f.write("@cwd /\n")
usr_local = False
for fn in filenames:
f.write(os.path.join(dn, fn) + "\n")
if dn and dn not in keepdirs and not py_lib.match(dn):
f.write("@dirrm %s\n" % dn)
if args.make_package or args.local_dist:
subprocess.check_call(("make", "clean", "package", "DISTDIR=" + args.portsdir, "PKGREPOSITORY=" + pkgdir), cwd = base)
if not args.no_clean:
subprocess.check_call(("make", "clean"), cwd = base)
if not args.no_tarball and not args.no_clean:
subprocess.check_call(("tar", "czf", "%s-port.tgz" % port, port), cwd = args.portsdir)
base = os.path.join(args.portsdir, port)
stage = os.path.join(base, "work", "stage")
fn = os.path.join(args.portsdir, port, "Makefile")
with open(fn, "r") as f:
template = f.read()
with open(fn, "w") as f:
f.write(template % formatdict)
subprocess.check_call(("make", "makesum", "stage", "DISTDIR=" + args.portsdir, "NO_DEPENDS=yes"),
cwd = base)
with open(os.path.join(base, "pkg-plist"), "w") as f:
usr_local = None
for dirpath, dirnames, filenames in os.walk(stage, topdown = False):
dn = dirpath[len(stage)+1:]
if dn.startswith("usr/local"):
if not usr_local and usr_local is not None:
f.write("@cwd\n")
usr_local = True
dn = dn[len("usr/local/"):]
dn = py_sitelib.sub("%%PYTHON_SITELIBDIR%%", dn)
if dn == "etc/rc.d":
continue
else:
if usr_local:
f.write("@cwd /\n")
usr_local = False
for fn in filenames:
f.write(os.path.join(dn, fn) + "\n")
if dn and dn not in keepdirs and not py_lib.match(dn):
f.write("@dirrm %s\n" % dn)
if args.make_package or args.local_dist:
subprocess.check_call(("make", "clean", "package", "DISTDIR=" + args.portsdir, "PKGREPOSITORY=" + pkgdir), cwd = base)
if not args.no_clean:
subprocess.check_call(("make", "clean"), cwd = base)
if not args.no_tarball and not args.no_clean:
subprocess.check_call(("tar", "czf", "%s-port.tgz" % port, port), cwd = args.portsdir)
@@ -2,11 +2,11 @@
#
# Copyright (C) 2014 Dragon Research Labs ("DRL")
# Portions copyright (C) 2013 Internet Systems Consortium ("ISC")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notices and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND DRL AND ISC DISCLAIM ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DRL OR
View
@@ -8,11 +8,11 @@
# code with code maintained by humans, so "nasty" is a relative term.
#
# Copyright (C) 2011-2012 Internet Systems Consortium ("ISC")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
@@ -68,24 +68,24 @@
'''
if len(sys.argv) < 2:
sys.exit("Usage: %s source.c [source.c ...]" % sys.argv[0])
sys.exit("Usage: %s source.c [source.c ...]" % sys.argv[0])
splitter = re.compile("[() \t]+").split
token = None
for line in fileinput.input():
if token is None:
path = fileinput.filename().split(os.path.sep)
path = os.path.join(path[-2], path[-1]) if len(path) > 1 else path[-1]
token = "".join(c if c.isalnum() else "_" for c in path.upper())
sys.stdout.write(header.replace("%", token))
if token is None:
path = fileinput.filename().split(os.path.sep)
path = os.path.join(path[-2], path[-1]) if len(path) > 1 else path[-1]
token = "".join(c if c.isalnum() else "_" for c in path.upper())
sys.stdout.write(header.replace("%", token))
if "DECLARE_STACK_OF" in line:
words = splitter(line)
if len(words) > 1 and words[0] == "DECLARE_STACK_OF":
sys.stdout.write(template.replace("%", words[1]))
if "DECLARE_STACK_OF" in line:
words = splitter(line)
if len(words) > 1 and words[0] == "DECLARE_STACK_OF":
sys.stdout.write(template.replace("%", words[1]))
if token is not None:
sys.stdout.write(footer.replace("%", token))
sys.stdout.write(footer.replace("%", token))
@@ -24,8 +24,8 @@
''' % os.environ)
for k, v in os.environ.iteritems():
if k.startswith("AC_") and k != "AC_PYTHON_INTERPRETER":
sys.stdout.write("%s = '''%s'''\n" % (k.lower(), v))
if k.startswith("AC_") and k != "AC_PYTHON_INTERPRETER":
sys.stdout.write("%s = '''%s'''\n" % (k.lower(), v))
sys.stdout.write('''\
View
@@ -1,5 +1,5 @@
# $Id$
#
#
# Copyright (C) 2014 Dragon Research Labs ("DRL")
# Portions copyright (C) 2009--2012 Internet Systems Consortium ("ISC")
# Portions copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN")
@@ -40,13 +40,13 @@
"""
def symbol(s):
for suffix in (".rng", "-schema"):
if s.endswith(suffix):
s = s[:-len(suffix)]
return s.replace("-", "_")
for suffix in (".rng", "-schema"):
if s.endswith(suffix):
s = s[:-len(suffix)]
return s.replace("-", "_")
sys.stdout.write(header)
for fn in sys.argv[1:]:
with open(fn, "r") as f:
sys.stdout.write(format % dict(name = symbol(fn), rng = f.read()))
with open(fn, "r") as f:
sys.stdout.write(format % dict(name = symbol(fn), rng = f.read()))
sys.stdout.write(footer)
@@ -1,25 +1,25 @@
# $Id$
#
#
# Copyright (C) 2009-2012 Internet Systems Consortium ("ISC")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
#
# Portions copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
@@ -47,6 +47,6 @@
print format_1
for name in schemas:
print format_2 % {
"name" : name,
"sql" : open(name + ".sql").read() }
print format_2 % {
"name" : name,
"sql" : open(name + ".sql").read() }
View
@@ -2,11 +2,11 @@
# $Id$
# Copyright (C) 2013 Internet Systems Consortium ("ISC")
#
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
@@ -37,33 +37,33 @@
unknown = "Unknown"
try:
v = subprocess.Popen(("svnversion", "-c"), stdout = subprocess.PIPE).communicate()[0]
err = None
v = subprocess.Popen(("svnversion", "-c"), stdout = subprocess.PIPE).communicate()[0]
err = None
except Exception, e:
v = unknown
err = e
v = unknown
err = e
if any(s in v for s in ("Unversioned", "Uncommitted", unknown)):
v = unknown
v = unknown
else:
v = "0." + v.strip().split(":")[-1].translate(None, "SMP")
v = "0." + v.strip().split(":")[-1].translate(None, "SMP")
try:
old = open("VERSION", "r").read().strip()
old = open("VERSION", "r").read().strip()
except:
old = None
old = None
if err is not None and (old is None or old == unknown):
sys.stderr.write("Warning: No saved version and svnversion failed: %s\n" % err)
sys.stderr.write("Warning: No saved version and svnversion failed: %s\n" % err)
if v == unknown:
if old is not None and old != unknown:
v = old
else:
sys.stderr.write("Warning: Could not determine software version\n")
if old is not None and old != unknown:
v = old
else:
sys.stderr.write("Warning: Could not determine software version\n")
if old is None or v != old:
with open("rpki/version.py", "w") as f:
f.write("VERSION = \"%s\"\n" % v)
with open("VERSION", "w") as f:
f.write(v + "\n")
with open("rpki/version.py", "w") as f:
f.write("VERSION = \"%s\"\n" % v)
with open("VERSION", "w") as f:
f.write(v + "\n")
Oops, something went wrong.

0 comments on commit b46deb1

Please sign in to comment.