From 468a6650e7398bd30c7960a543b231fba109fcf6 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Fri, 21 Sep 2012 12:12:09 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1388449 13f79535-47bb-0310-9956-ffa450edef68 --- dev-tools/scripts/checkJavadocLinks.py | 35 +++++++++++++------------- lucene/common-build.xml | 27 ++++++++++---------- solr/common-build.xml | 4 +-- 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/dev-tools/scripts/checkJavadocLinks.py b/dev-tools/scripts/checkJavadocLinks.py index 21c855b5477..35bf05eb516 100644 --- a/dev-tools/scripts/checkJavadocLinks.py +++ b/dev-tools/scripts/checkJavadocLinks.py @@ -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 diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 1d8d357c204..35b650ce524 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -27,10 +27,10 @@ - - - - + + + + @@ -65,7 +65,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -144,11 +144,11 @@ - + - + @@ -161,8 +161,8 @@ - - + + @@ -1805,11 +1805,10 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites - - + - + diff --git a/solr/common-build.xml b/solr/common-build.xml index fa481282425..25e8a040c91 100644 --- a/solr/common-build.xml +++ b/solr/common-build.xml @@ -46,8 +46,8 @@ - - + +