diff --git a/debian/changelog b/debian/changelog index 3610bce3..a960e424 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linkchecker (1.3.10) unstable; urgency=low + + * use Pythons builtin HTTPS support + + -- Bastian Kleineidam Tue, 20 Nov 2001 21:24:28 +0100 + linkchecker (1.3.9) unstable; urgency=low * new config option --interactive for interactive URL input diff --git a/debian/control b/debian/control index deed6703..0c60e2b7 100644 --- a/debian/control +++ b/debian/control @@ -3,13 +3,13 @@ Section: web Priority: optional Maintainer: Bastian Kleineidam Build-Depends-Indep: python-dev (>= 2.1), python-dev (<< 2.2), debhelper (>= 3.0.0), gettext -Standards-Version: 3.5.6 +Standards-Version: 3.5.6.0 Package: linkchecker -Architecture: all +Architecture: any Depends: python (>= 2.1) -Conflicts: python (>= 2.2) -Suggests: linkchecker-ssl +Conflicts: python (>= 2.2), python-ssl (>= 2.2) +Suggests: python-ssl (>= 2.1) Description: check HTML documents for broken links Features: o recursive checking @@ -25,3 +25,5 @@ Description: check HTML documents for broken links o i18n support o command line interface o (Fast)CGI web interface (requires HTTP server) + + You have to install python-ssl for HTTPS support. diff --git a/debian/linkchecker-ssl.postinst b/debian/linkchecker-ssl.postinst deleted file mode 100644 index 2513c43d..00000000 --- a/debian/linkchecker-ssl.postinst +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -e -# -# Written 1998 by Gregor Hoffleit . -# used by Bastian Kleineidam for LinkChecker - -PYTHON=python2.1 -FILELIST= -SITEPACKAGES=/usr/lib/$PYTHON/site-packages -DIRLIST=linkcheckssl -COMMAND="'import sys,py_compile;py_compile.compile(sys.argv[1])'" - -case "$1" in - configure|abort-upgrade|abort-remove|abort-deconfigure) - for i in $DIRLIST; do - $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $SITEPACKAGES/$i - $PYTHON /usr/lib/$PYTHON/compileall.py -q $SITEPACKAGES/$i - done - # use /bin/sh -c, otherwise I get a SyntaxError from Python - for i in $FILELIST; do - /bin/sh -c "$PYTHON -O -c $COMMAND $SITEPACKAGES/$i" - /bin/sh -c "$PYTHON -c $COMMAND $SITEPACKAGES/$i" - done - ;; - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/linkchecker-ssl.prerm b/debian/linkchecker-ssl.prerm deleted file mode 100644 index 75589fda..00000000 --- a/debian/linkchecker-ssl.prerm +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -e -# -# Written 1998 by Gregor Hoffleit . -# used by Bastian Kleineidam for LinkChecker - -PYTHON=python2.1 -PACKAGE=linkchecker-ssl - -#DEBHELPER# - -dpkg --listfiles $PACKAGE | - awk '$0~/\.py$/ {print $0"c\n" $0"o"}' | - xargs rm -f >&2 - -rmdir /usr/lib/$PYTHON/site-packages/linkcheckssl 2>/dev/null || true - -exit 0 diff --git a/debian/rules b/debian/rules index b730d27b..7eff8d08 100755 --- a/debian/rules +++ b/debian/rules @@ -17,14 +17,13 @@ export DH_OPTIONS configure: configure-stamp configure-stamp: dh_testdir - $(PYTHON) setup.py config -lcrypto + $(PYTHON) setup.py config touch configure-stamp build: configure-stamp build-stamp build-stamp: dh_testdir - rm -rf debian/linkchecker debian/linkchecker-ssl $(PYTHON) setup.py build touch build-stamp @@ -44,8 +43,6 @@ install: build rm -r debian/$(PACKAGE)/usr/man # remove files, we install them below rm -r debian/$(PACKAGE)/usr/share/linkchecker/examples - # remove any SSL related files - rm -r debian/$(PACKAGE)/usr/lib/$(PYTHON)/site-packages/linkcheckssl # install additional doc files install -c -m 644 DNS/README $(DOCDIR)/README_DNS.txt install -c -m 644 test/*.py $(DOCDIR)/test diff --git a/linkcheck/FileUrlData.py b/linkcheck/FileUrlData.py index 2a85893d..a9b6ef87 100644 --- a/linkcheck/FileUrlData.py +++ b/linkcheck/FileUrlData.py @@ -15,10 +15,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import re,string,os,urlparse,urllib -from UrlData import UrlData +import re, os, urlparse, urllib +from UrlData import UrlData, ExcList from linkcheck import _ +# OSError is thrown on Windows when a file is not found +ExcList.append(OSError) + html_re = re.compile(r'(?i)\.s?html?$') html_content_re = re.compile(r'(?i).*') opera_re = re.compile(r'^(?i)opera.adr$') @@ -48,7 +51,7 @@ class FileUrlData(UrlData): self.urlName = os.getcwd()+"/"+self.urlName if winre.search(self.urlName): self.adjustWinPath() - self.urlName = string.replace(self.urlName, "\\", "/") + self.urlName = self.urlName.replace("\\", "/") self.urlName = "file://"+self.urlName diff --git a/linkcheck/HttpUrlData.py b/linkcheck/HttpUrlData.py index 9aa53de7..81958a2c 100644 --- a/linkcheck/HttpUrlData.py +++ b/linkcheck/HttpUrlData.py @@ -15,8 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import httplib,urlparse,sys,time,re -import Config,StringUtil,robotparser2 +import httplib, urlparse, sys, time, re +import Config, StringUtil, robotparser2 from UrlData import UrlData from urllib import splittype, splithost, splituser, splitpasswd from linkcheck import _ @@ -223,7 +223,10 @@ class HttpUrlData(UrlData): return self.urlConnection.getreply() def _getHTTPObject(self, host): - return httplib.HTTP(host) + h = httplib.HTTP() + h.set_debuglevel(Config.DebugLevel) + h.connect(host) + return h def getContent(self): if not self.has_content: diff --git a/linkcheck/HttpsUrlData.py b/linkcheck/HttpsUrlData.py index 833027f5..b97189ea 100644 --- a/linkcheck/HttpsUrlData.py +++ b/linkcheck/HttpsUrlData.py @@ -17,19 +17,16 @@ from UrlData import UrlData from HttpUrlData import HttpUrlData -from linkcheck import _ -_supportHttps=1 -try: - from linkcheckssl import httpslib -except ImportError: - _supportHttps=0 +from linkcheck import _, Config +_supportHttps = hasattr(httplib, "HTTPS") class HttpsUrlData(HttpUrlData): """Url link with https scheme""" def _getHTTPObject(self, host): - h = httpslib.HTTPS() + h = httplib.HTTPS() + h.set_debuglevel(Config.DebugLevel) h.connect(host) return h diff --git a/linkcheck/UrlData.py b/linkcheck/UrlData.py index c91db1b1..16f53737 100644 --- a/linkcheck/UrlData.py +++ b/linkcheck/UrlData.py @@ -15,10 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import sys,re,string,urlparse,urllib,time,DNS -import Config,StringUtil,linkcheck,linkname +import sys, re, urlparse, urllib, time, DNS, traceback +import Config, StringUtil, linkcheck, linkname +debug = Config.debug from linkcheck import _ -debug = linkcheck.Config.debug from debuglevels import * # we catch these exceptions, all other exceptions are internal @@ -43,7 +43,7 @@ _linkMatcher = r""" \s* # whitespace %s # tag name \s+ # whitespace - [^>]*? # skip leading attributes + [^>]*? # skip leading attributes (fails on Python 2.2b2) %s # attrib name \s* # whitespace = # equal sign @@ -108,8 +108,7 @@ BasePattern = { 'attr': 'href', } -CommentPattern = re.compile("