You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2012/09/21 14:17:09 UTC
svn commit: r1388453 - in /lucene/dev/branches/branch_4x: ./ dev-tools/
dev-tools/scripts/checkJavadocLinks.py lucene/ lucene/common-build.xml
solr/ solr/common-build.xml
Author: uschindler
Date: Fri Sep 21 12:17:09 2012
New Revision: 1388453
URL: http://svn.apache.org/viewvc?rev=1388453&view=rev
Log:
Merged revision(s) 1388449 from lucene/dev/trunk:
Fix the llinter issue with absolute file names intermixed with url, failing to parse them as URLs (C:/path is treated as URL with schema C). Fix other properties to be absolute in common-build.xml.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/dev-tools/ (props changed)
lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/common-build.xml (contents, props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/common-build.xml (contents, props changed)
Modified: lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py?rev=1388453&r1=1388452&r2=1388453&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py (original)
+++ lucene/dev/branches/branch_4x/dev-tools/scripts/checkJavadocLinks.py Fri Sep 21 12:17:09 2012
@@ -136,6 +136,9 @@ def checkAll(dirName):
# Somehow even w/ java 7 generaged javadocs,
# deprecated-list.html can fail to escape generics types
fullPath = os.path.join(root, f).replace(os.path.sep,'/')
+ fullPath = 'file:%s' % urlparse.quote(fullPath)
+ # parse and unparse the URL to "normalize" it
+ fullPath = urlparse.urlunparse(urlparse.urlparse(fullPath))
#print ' %s' % fullPath
allFiles[fullPath] = parse(fullPath, open('%s/%s' % (root, f), encoding='UTF-8').read())
@@ -209,30 +212,26 @@ def checkAll(dirName):
# on annotations it seems?
pass
elif link.startswith('file:'):
- filepath = urlparse.unquote(urlparse.urlparse(link).path)
- if not (os.path.exists(filepath) or os.path.exists(filepath[1:])):
- if not printed:
- printed = True
- print()
- print(fullPath)
- print(' BROKEN LINK: %s' % link)
- elif link not in allFiles:
- # We only load HTML... so if the link is another resource (eg
- # SweetSpotSimilarity refs
- # lucene/build/docs/misc/org/apache/lucene/misc/doc-files/ss.gnuplot) then it's OK:
- if not os.path.exists(link):
- if not printed:
- printed = True
- print()
- print(fullPath)
- print(' BROKEN LINK: %s' % link)
+ if link not in allFiles:
+ filepath = urlparse.unquote(urlparse.urlparse(link).path)
+ if not (os.path.exists(filepath) or os.path.exists(filepath[1:])):
+ if not printed:
+ printed = True
+ print()
+ print(fullPath)
+ print(' BROKEN LINK: %s' % link)
elif anchor is not None and anchor not in allFiles[link][1]:
if not printed:
printed = True
print()
print(fullPath)
print(' BROKEN ANCHOR: %s' % origLink)
-
+ else:
+ if not printed:
+ printed = True
+ print()
+ print(fullPath)
+ print(' BROKEN URL SCHEME: %s' % origLink)
failures = failures or printed
return failures
Modified: lucene/dev/branches/branch_4x/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/common-build.xml?rev=1388453&r1=1388452&r2=1388453&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/common-build.xml Fri Sep 21 12:17:09 2012
@@ -27,10 +27,10 @@
</description>
<dirname file="${ant.file.common}" property="common.dir"/>
- <property name="dev-tools.dir" value="${common.dir}/../dev-tools"/>
- <property name="prettify.dir" value="${common.dir}/tools/prettify"/>
- <property name="maven.build.dir" value="${build.dir}/maven"/>
- <property name="license.dir" value="${common.dir}/licenses"/>
+ <property name="dev-tools.dir" location="${common.dir}/../dev-tools"/>
+ <property name="prettify.dir" location="${common.dir}/tools/prettify"/>
+ <property name="maven.build.dir" location="${build.dir}/maven"/>
+ <property name="license.dir" location="${common.dir}/licenses"/>
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it -->
@@ -65,7 +65,7 @@
<property name="ivy.sync" value="true"/>
<property name="junit.jar" value="junit-4.10.jar"/>
- <property name="junit-location.jar" value="${common.dir}/test-framework/lib/${junit.jar}"/>
+ <property name="junit-location.jar" location="${common.dir}/test-framework/lib/${junit.jar}"/>
<path id="junit-path">
<fileset dir="${common.dir}/test-framework/lib">
@@ -90,7 +90,7 @@
<property name="tests.timezone" value="random" />
<property name="tests.directory" value="random" />
<property name="tests.linedocsfile" value="europarl.lines.txt.gz" />
- <property name="tests.loggingfile" value="${common.dir}/tools/junit4/logging.properties"/>
+ <property name="tests.loggingfile" location="${common.dir}/tools/junit4/logging.properties"/>
<property name="tests.nightly" value="false" />
<property name="tests.weekly" value="false" />
<property name="tests.slow" value="true" />
@@ -109,7 +109,7 @@
</condition>
<property name="tests.clover.args" value=""/>
- <property name="tests.tempDir" value="${build.dir}/test"/>
+ <property name="tests.tempDir" location="${build.dir}/test"/>
<property name="tests.cachefile" location="${common.dir}/tools/junit4/cached-timehints.txt" />
<property name="tests.cachefilehistory" value="20" />
@@ -144,11 +144,11 @@
<property name="bootclasspath" value=""/>
<property name="javadoc.link" value="http://download.oracle.com/javase/6/docs/api/"/>
<property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/>
- <property name="javadoc.packagelist.dir" value="${common.dir}/tools/javadoc"/>
+ <property name="javadoc.packagelist.dir" location="${common.dir}/tools/javadoc"/>
<available file="${javadoc.packagelist.dir}/java6/package-list" property="javadoc.java6.packagelist.exists"/>
<property name="javadoc.access" value="protected"/>
<property name="javadoc.charset" value="utf-8"/>
- <property name="javadoc.dir" value="${common.dir}/build/docs"/>
+ <property name="javadoc.dir" location="${common.dir}/build/docs"/>
<property name="javadoc.maxmemory" value="512m" />
<property name="javadoc.noindex" value="true"/>
<!-- Javadoc classpath -->
@@ -161,8 +161,8 @@
</fileset>
</path>
- <property name="changes.src.dir" value="${common.dir}/site/changes"/>
- <property name="changes.target.dir" value="${common.dir}/build/docs/changes"/>
+ <property name="changes.src.dir" location="${common.dir}/site/changes"/>
+ <property name="changes.target.dir" location="${common.dir}/build/docs/changes"/>
<property name="project.name" value="site"/> <!-- todo: is this used by anakia or something else? -->
<property name="build.encoding" value="utf-8"/>
@@ -1805,11 +1805,10 @@ ${tests-output}/junit4-*.suites - pe
<macrodef name="check-broken-links">
<attribute name="dir"/>
- <!-- TODO: somehow, the behavior of this script has CWD-funkiness but only on windows -->
<sequential>
- <exec dir="@{dir}" executable="${python32.exe}" failonerror="true">
+ <exec dir="." executable="${python32.exe}" failonerror="true">
<arg value="${dev-tools.dir}/scripts/checkJavadocLinks.py"/>
- <arg value="."/>
+ <arg value="@{dir}"/>
</exec>
</sequential>
</macrodef>
Modified: lucene/dev/branches/branch_4x/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/common-build.xml?rev=1388453&r1=1388452&r2=1388453&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/common-build.xml Fri Sep 21 12:17:09 2012
@@ -46,8 +46,8 @@
<property name="tests.loggingfile" location="${common-solr.dir}/testlogging.properties"/>
<property name="tests.cleanthreads.sysprop" value="perClass"/>
- <property name="changes.target.dir" value="${dest}/docs/changes"/>
- <property name="license.dir" value="${common-solr.dir}/licenses"/>
+ <property name="changes.target.dir" location="${dest}/docs/changes"/>
+ <property name="license.dir" location="${common-solr.dir}/licenses"/>
<import file="${common-solr.dir}/../lucene/module-build.xml"/>