You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2012/09/26 16:51:37 UTC
svn commit: r1390534 -
/lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
Author: mikemccand
Date: Wed Sep 26 14:51:36 2012
New Revision: 1390534
URL: http://svn.apache.org/viewvc?rev=1390534&view=rev
Log:
LUCENE-4430: check for/warn about javax.* and java.* class in any Lucene/Solr, or dependency JARs
Modified:
lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
Modified: lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py?rev=1390534&r1=1390533&r2=1390534&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py Wed Sep 26 14:51:36 2012
@@ -162,17 +162,32 @@ def noJavaPackageClasses(desc, file):
with zipfile.ZipFile(file) as z2:
for name2 in z2.namelist():
if name2.endswith('.class') and (name2.startswith('java/') or name2.startswith('javax/')):
- raise RuntimeError('%s contains sheisty class "%s"' % \
- (desc, name2))
+ raise RuntimeError('%s contains sheisty class "%s"' % (desc, name2))
-def checkAllLuceneJARs(root):
- print(' make sure Lucene JARs don\'t have javax.* or java.* classes...')
- for root, dirs, files in os.walk(root):
+def normSlashes(path):
+ return path.replace(os.sep, '/')
+
+def checkAllJARs(topDir, project):
+ print(' make sure JARs don\'t have javax.* or java.* classes...')
+ for root, dirs, files in os.walk(topDir):
+
+ normRoot = normSlashes(root)
+
+ if project == 'solr' and normRoot.endswith('/example/lib'):
+ # Solr's example intentionally ships servlet JAR:
+ continue
+
for file in files:
if file.lower().endswith('.jar'):
+ if project == 'solr':
+
+ if normRoot.endswith('/contrib/dataimporthandler/lib') and (file.startswith('mail-') or file.startswith('activation-')):
+ print(' **WARNING**: skipping check of %s/%s: it has javax.* classes' % (root, file))
+ continue
+
fullPath = '%s/%s' % (root, file)
noJavaPackageClasses('JAR file "%s"' % fullPath, fullPath)
-
+
def checkSolrWAR(warFileName):
"""
@@ -561,8 +576,10 @@ def verifyUnpacked(project, artifact, un
testNotice(unpackPath)
else:
+
+ checkAllJARs(os.getcwd(), project)
+
if project == 'lucene':
- checkAllLuceneJARs(os.getcwd())
testDemo(isSrc, version)
else: