diff options
Diffstat (limited to 'usr/src/tools/onbld/Checks')
-rw-r--r-- | usr/src/tools/onbld/Checks/Cddl.py | 2 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/CmtBlk.py | 2 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/Comments.py | 4 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/Copyright.py | 2 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/DbLookups.py | 31 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/HdrChk.py | 2 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/Keywords.py | 4 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/Mapfile.py | 2 | ||||
-rw-r--r-- | usr/src/tools/onbld/Checks/__init__.py | 2 |
9 files changed, 37 insertions, 14 deletions
diff --git a/usr/src/tools/onbld/Checks/Cddl.py b/usr/src/tools/onbld/Checks/Cddl.py index 1f5f99f953..0f4d995e89 100644 --- a/usr/src/tools/onbld/Checks/Cddl.py +++ b/usr/src/tools/onbld/Checks/Cddl.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON CDDL = ''' CDDL HEADER START diff --git a/usr/src/tools/onbld/Checks/CmtBlk.py b/usr/src/tools/onbld/Checks/CmtBlk.py index 2f3d29fa79..ddf5caec48 100644 --- a/usr/src/tools/onbld/Checks/CmtBlk.py +++ b/usr/src/tools/onbld/Checks/CmtBlk.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START diff --git a/usr/src/tools/onbld/Checks/Comments.py b/usr/src/tools/onbld/Checks/Comments.py index daf6aa47d9..5d6feb265a 100644 --- a/usr/src/tools/onbld/Checks/Comments.py +++ b/usr/src/tools/onbld/Checks/Comments.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # @@ -38,7 +38,7 @@ import re, sys from onbld.Checks.DbLookups import BugDB -bugre = re.compile(r'^(\d{2,7}) (.*)$') +bugre = re.compile(r'^(\d{2,7}|[A-Z]{1,7}-\d{1,7}) (.*)$') def isBug(comment): diff --git a/usr/src/tools/onbld/Checks/Copyright.py b/usr/src/tools/onbld/Checks/Copyright.py index 81a80058aa..8071b7f435 100644 --- a/usr/src/tools/onbld/Checks/Copyright.py +++ b/usr/src/tools/onbld/Checks/Copyright.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # diff --git a/usr/src/tools/onbld/Checks/DbLookups.py b/usr/src/tools/onbld/Checks/DbLookups.py index 11fd4185be..2843673035 100644 --- a/usr/src/tools/onbld/Checks/DbLookups.py +++ b/usr/src/tools/onbld/Checks/DbLookups.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # @@ -37,6 +37,7 @@ import htmllib import re import urllib import urllib2 +import json try: # Python >= 2.5 from xml.etree import ElementTree @@ -62,9 +63,9 @@ class BugDB(object): print r["6505625"]["synopsis"] """ - VALID_DBS = ["illumos"] + VALID_DBS = ["illumos", "smartos"] - def __init__(self, priority = ["illumos"]): + def __init__(self, priority = VALID_DBS): """Create a BugDB object. Keyword argument: @@ -75,6 +76,24 @@ class BugDB(object): raise BugDBException, database self.__priority = priority + def __smartosbug(self, cr): + url = "http://smartos.org/bugview/json/%s" % cr + req = urllib2.Request(url) + + try: + data = urllib2.urlopen(req) + except urllib2.HTTPError, e: + if e.code == 404 or e.code == 403 or e.code == 400: + raise NonExistentBug(cr) + else: + raise + + bug = json.load(data) + + return {'cr_number': bug['id'], + 'synopsis': bug['summary'] + } + def __illbug(self, cr): url = "http://illumos.org/issues/%s.xml" % cr @@ -117,6 +136,12 @@ class BugDB(object): results[str(cr)] = self.__illbug(cr) except NonExistentBug: continue + elif database == "smartos": + for cr in crs: + try: + results[str(cr)] = self.__smartosbug(cr) + except NonExistentBug: + continue # the CR has already been found by one bug database # so don't bother looking it up in the others diff --git a/usr/src/tools/onbld/Checks/HdrChk.py b/usr/src/tools/onbld/Checks/HdrChk.py index c2697dcaf2..8f7b946d12 100644 --- a/usr/src/tools/onbld/Checks/HdrChk.py +++ b/usr/src/tools/onbld/Checks/HdrChk.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # diff --git a/usr/src/tools/onbld/Checks/Keywords.py b/usr/src/tools/onbld/Checks/Keywords.py index 5c374c3abb..ac3555be32 100644 --- a/usr/src/tools/onbld/Checks/Keywords.py +++ b/usr/src/tools/onbld/Checks/Keywords.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # @@ -24,8 +24,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Mercurial (lack of) keyword checks diff --git a/usr/src/tools/onbld/Checks/Mapfile.py b/usr/src/tools/onbld/Checks/Mapfile.py index 2a8cb74aed..d4fa70d141 100644 --- a/usr/src/tools/onbld/Checks/Mapfile.py +++ b/usr/src/tools/onbld/Checks/Mapfile.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # diff --git a/usr/src/tools/onbld/Checks/__init__.py b/usr/src/tools/onbld/Checks/__init__.py index 7051b0c565..2fde833098 100644 --- a/usr/src/tools/onbld/Checks/__init__.py +++ b/usr/src/tools/onbld/Checks/__init__.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!ON_PYTHON # # CDDL HEADER START # |