From 12bab5e94ab250159539b32c15e50ba4a1559865 Mon Sep 17 00:00:00 2001 From: calvin Date: Sun, 29 Apr 2001 19:49:33 +0000 Subject: [PATCH] debian fixes git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@252 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- Makefile | 2 +- debian/changelog | 4 +- debian/control-ssl | 6 +- debian/linkchecker.links | 1 + debian/rules | 10 +- linkcheck/Config.py | 4 +- linkchecker | 2 +- po/de.po | 228 +++++++++++++++++++-------------------- po/fr.po | 210 ++++++++++++++++++------------------ setup.py | 101 +++++++++++------ test/output/test_ftp | 6 +- test/output/test_http | 7 ++ 12 files changed, 312 insertions(+), 269 deletions(-) create mode 100644 debian/linkchecker.links diff --git a/Makefile b/Makefile index d6ad8f24..16c1eeea 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ VERSION: echo $(VERSION) > VERSION .PHONY: upload -upload: distclean dist files VERSION +upload: distclean dist deb files VERSION scp debian/changelog $(HTMLDIR)/changes.txt scp README $(HTMLDIR)/readme.txt scp linkchecker-out.* $(HTMLDIR) diff --git a/debian/changelog b/debian/changelog index 6e0a2b9c..b17c9caf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,10 @@ linkchecker (1.3.0) unstable; urgency=low Python 2.0 compatibility (thanks to Allan Bailey for the patch) * additionally allow https in the CGI script (thanks to Allan Bailey for the patch) + * fix for distutils bug: python2None interpreter is wrong + * fix default location of global config file - -- Bastian Kleineidam Sat, 28 Apr 2001 21:46:06 +0200 + -- Bastian Kleineidam Sun, 29 Apr 2001 02:09:41 +0200 linkchecker (1.2.15) unstable; urgency=low diff --git a/debian/control-ssl b/debian/control-ssl index 15a8866e..61a37725 100644 --- a/debian/control-ssl +++ b/debian/control-ssl @@ -4,15 +4,15 @@ Priority: optional Maintainer: Bastian Kleineidam Build-Depends: python2-base, python2-dev, debhelper (>= 3.0.0), libssl-dev Build-Depends-Indep: gettext -Standards-Version: 3.5.2 +Standards-Version: 3.5.3 Package: linkchecker-ssl Architecture: any Depends: python2-base Recommends: linkchecker (>= ${Source-Version}) -Description: HTTPS modules for linkchecker +Description: HTTPS module for linkchecker Includes the Python module 'linkcheckerssl' to support https:// - links for linkchecker. + links for LinkChecker. . Linkchecker features: o recursive checking diff --git a/debian/linkchecker.links b/debian/linkchecker.links new file mode 100644 index 00000000..3c002d60 --- /dev/null +++ b/debian/linkchecker.links @@ -0,0 +1 @@ +/etc/linkcheckerrc /usr/share/linkchecker/linkcheckerrc diff --git a/debian/rules b/debian/rules index 80185276..f9f851d7 100755 --- a/debian/rules +++ b/debian/rules @@ -38,18 +38,18 @@ install: build $(MAKE) locale ./setup.py install --root=`pwd`/debian/$(PACKAGE) --no-compile # remove man pages, we install them with dh_installman - rm -rf debian/$(PACKAGE)/usr/man + rm -r debian/$(PACKAGE)/usr/man # remove example files, we install them with dh_installexamples - rm -rf debian/$(PACKAGE)/usr/share/linkchecker + rm -r debian/$(PACKAGE)/usr/share/linkchecker/examples/ # remove any SSL related files - rm -rf debian/$(PACKAGE)/usr/lib/python2.0/site-lib/linkchecker-ssl + rm -r debian/$(PACKAGE)/usr/lib/python2.0/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 install -c -m 644 test/html/*.html $(DOCDIR)/test/html install -c -m 644 test/output/test_* $(DOCDIR)/test/output # install system wide configuration file in etc - install -c -m 644 linkcheckerrc debian/$(PACKAGE)/etc + mv debian/$(PACKAGE)/usr/share/linkchecker/linkcheckerrc debian/$(PACKAGE)/etc # Build architecture-independent files here. @@ -68,7 +68,7 @@ binary-indep: build install # dh_installinfo # dh_undocumented linkchecker.1 dh_installchangelogs -# dh_link + dh_link dh_strip dh_compress dh_fixperms diff --git a/linkcheck/Config.py b/linkcheck/Config.py index af8593cf..e506e5d0 100644 --- a/linkcheck/Config.py +++ b/linkcheck/Config.py @@ -360,7 +360,7 @@ class Configuration(UserDict.UserDict): def read(self, files = []): if not files: # system wide config settings - config_dir = join(_linkchecker_configdata.install_data, 'linkchecker') + config_dir = join(_linkchecker_configdata.install_data, 'share/linkchecker') files.append(norm(join(config_dir, "linkcheckerrc"))) # per user config settings files.append(norm("~/.linkcheckerrc")) @@ -415,8 +415,8 @@ class Configuration(UserDict.UserDict): self.newLogger(arg, {'fileoutput':1})) except ConfigParser.Error: pass for key in Loggers.keys(): - debug(key+"\n") if cfgparser.has_section(key): + debug(key+"\n") for opt in cfgparser.options(key): try: self[key][opt] = cfgparser.get(key, opt) except ConfigParser.Error, msg: debug(str(msg)) diff --git a/linkchecker b/linkchecker index eb96757d..35998200 100755 --- a/linkchecker +++ b/linkchecker @@ -48,7 +48,7 @@ For single-letter option arguments the space is not a necessity. So ~/.linkcheckerrc and then /etc/linkcheckerrc (under Windows \\linkcheckerrc). -F type[/filename], --file-output=type[/filename] - Same as output, but write to a file linkchecker-out. + Same as -o, but write to a file linkchecker-out. or if specified. If the file already exists, it is overwritten. You can specify this option more than once. There is no file output for the blacklist logger. Default is diff --git a/po/de.po b/po/de.po index cdaf7ec3..52612de5 100644 --- a/po/de.po +++ b/po/de.po @@ -69,6 +69,119 @@ msgstr "" msgid "Effective URL %s" msgstr "Effektive URL %s" +msgid ", line " +msgstr ", Zeile " + +msgid "url" +msgstr "" + +msgid "None of the mail hosts for %s accepts an SMTP connection: %s" +msgstr "Keiner der Mail Hosts für %s akzeptiert eine SMTP Verbindung: %s" + +msgid "name" +msgstr "" + +msgid "%.3f seconds\n" +msgstr "%.3f Sekunden\n" + +msgid "realurl" +msgstr "" + +msgid "" +"LinkChecker Online Error
Error
The LinkChecker Online script has " +"encountered an error. Please ensure that your provided URL link begins with " +"http:// and contains only these characters: A-Za-z0-9./_~-" +"

Errors are logged.
" +msgstr "" +"LinkChecker Online Fehler
Fehler
Das LinkChecker Online Skript ist " +"auf einen Fehler gestoßen. Bitte stellen Sie sicher, daß die " +"angegebene URL mit http:// beginnt und nur diese Zeichen " +"enthält: A-Za-z0-9./_~-

Fehler werden geloggt. " + +msgid "No adresses found" +msgstr "Keine Adressen gefunden" + +msgid "created by %s at %s\n" +msgstr "erstellt von %s um %s\n" + +msgid " found\n" +msgstr " gefunden\n" + +msgid "1 error" +msgstr "1 Fehler" + +msgid "Error" +msgstr "Fehler" + +msgid "1 warning, " +msgstr "1 Warnung, " + +#, fuzzy +msgid "info" +msgstr "Info" + +#, fuzzy +msgid "base" +msgstr "Basis" + +msgid "Valid" +msgstr "Gültig" + +msgid "hours" +msgstr "Stunden" + +msgid "Start checking at %s\n" +msgstr "Beginne Prüfen am %s\n" + +msgid "D/L Time" +msgstr "D/L Zeit" + +msgid "Base" +msgstr "Basis" + +msgid "seconds" +msgstr "Sekunden" + +msgid "URL" +msgstr "URL" + +msgid "Name" +msgstr "" + +msgid "URL is null or empty" +msgstr "URL ist Null oder leer" + +msgid " in %d links" +msgstr " in %d URLs" + +msgid " errors" +msgstr " Fehler" + +msgid "Info" +msgstr "Info" + +msgid "illegal recursionlevel number %d" +msgstr "illegale recursionlevel Nummer %d" + +msgid "%.3f seconds" +msgstr "%.3f Sekunden" + +msgid "Execute 'linkchecker -h' for help\n" +msgstr "Führen Sie 'linkchecker -h' aus, um Hilfe zu erhalten\n" + +msgid "HTTP 301 (moved permanent) encountered: you should update this link" +msgstr "" +"HTTP 301 (moved permanent) gefunden: Sie sollten diesen Link aktualisieren" + +#, fuzzy +msgid "checktime" +msgstr "Prüfzeit" + #, fuzzy msgid "" "USAGE\tlinkchecker [options] file-or-url...\n" @@ -91,7 +204,7 @@ msgid "" " ~/.linkcheckerrc and then /etc/linkcheckerrc\n" " (under Windows \\linkcheckerrc).\n" "-F type[/filename], --file-output=type[/filename]\n" -" Same as output, but write to a file linkchecker-out.\n" +" Same as -o, but write to a file linkchecker-out.\n" " or if specified. If the file already exists, it\n" " is overwritten. You can specify this option more than once.\n" " There is no file output for the blacklist logger. Default is\n" @@ -216,119 +329,6 @@ msgstr "" " 'Diese Seite ist umgezogen' oder 'Oracle Server Fehler'.\n" " Diese Option impliziert -w.\n" -msgid ", line " -msgstr ", Zeile " - -msgid "url" -msgstr "" - -msgid "None of the mail hosts for %s accepts an SMTP connection: %s" -msgstr "Keiner der Mail Hosts für %s akzeptiert eine SMTP Verbindung: %s" - -msgid "name" -msgstr "" - -msgid "%.3f seconds\n" -msgstr "%.3f Sekunden\n" - -msgid "realurl" -msgstr "" - -msgid "" -"LinkChecker Online Error
Error
The LinkChecker Online script has " -"encountered an error. Please ensure that your provided URL link begins with " -"http:// and contains only these characters: A-Za-z0-9./_~-" -"

Errors are logged.
" -msgstr "" -"LinkChecker Online Fehler
Fehler
Das LinkChecker Online Skript ist " -"auf einen Fehler gestoßen. Bitte stellen Sie sicher, daß die " -"angegebene URL mit http:// beginnt und nur diese Zeichen " -"enthält: A-Za-z0-9./_~-

Fehler werden geloggt. " - -msgid "No adresses found" -msgstr "Keine Adressen gefunden" - -msgid "created by %s at %s\n" -msgstr "erstellt von %s um %s\n" - -msgid " found\n" -msgstr " gefunden\n" - -msgid "1 error" -msgstr "1 Fehler" - -msgid "Error" -msgstr "Fehler" - -msgid "1 warning, " -msgstr "1 Warnung, " - -#, fuzzy -msgid "info" -msgstr "Info" - -#, fuzzy -msgid "base" -msgstr "Basis" - -msgid "Valid" -msgstr "Gültig" - -msgid "hours" -msgstr "Stunden" - -msgid "Start checking at %s\n" -msgstr "Beginne Prüfen am %s\n" - -msgid "D/L Time" -msgstr "D/L Zeit" - -msgid "Base" -msgstr "Basis" - -msgid "seconds" -msgstr "Sekunden" - -msgid "URL" -msgstr "URL" - -msgid "Name" -msgstr "" - -msgid "URL is null or empty" -msgstr "URL ist Null oder leer" - -msgid " in %d links" -msgstr " in %d URLs" - -msgid " errors" -msgstr " Fehler" - -msgid "Info" -msgstr "Info" - -msgid "illegal recursionlevel number %d" -msgstr "illegale recursionlevel Nummer %d" - -msgid "%.3f seconds" -msgstr "%.3f Sekunden" - -msgid "Execute 'linkchecker -h' for help\n" -msgstr "Führen Sie 'linkchecker -h' aus, um Hilfe zu erhalten\n" - -msgid "HTTP 301 (moved permanent) encountered: you should update this link" -msgstr "" -"HTTP 301 (moved permanent) gefunden: Sie sollten diesen Link aktualisieren" - -#, fuzzy -msgid "checktime" -msgstr "Prüfzeit" - msgid "dltime" msgstr "" diff --git a/po/fr.po b/po/fr.po index 3aa30b2d..ea1d1389 100644 --- a/po/fr.po +++ b/po/fr.po @@ -69,6 +69,110 @@ msgstr "" msgid "Effective URL %s" msgstr "URL effective %s" +msgid ", line " +msgstr ", ligne " + +msgid "url" +msgstr "" + +msgid "None of the mail hosts for %s accepts an SMTP connection: %s" +msgstr "Aucun des hôtes de messagerie pour %s n'accepte de connection SMTP: %s" + +msgid "name" +msgstr "" + +msgid "%.3f seconds\n" +msgstr "%.3f secondes\n" + +msgid "realurl" +msgstr "" + +msgid "" +"LinkChecker Online Error
Error
The LinkChecker Online script has " +"encountered an error. Please ensure that your provided URL link begins with " +"http:// and contains only these characters: A-Za-z0-9./_~-" +"

Errors are logged.
" +msgstr "" + +msgid "No adresses found" +msgstr "Aucune adresse trouvée" + +msgid "created by %s at %s\n" +msgstr "" + +msgid " found\n" +msgstr " trouvé\n" + +msgid "1 error" +msgstr "1 erreur" + +msgid "Error" +msgstr "Erreur" + +msgid "1 warning, " +msgstr "1 avertissement, " + +msgid "info" +msgstr "" + +#, fuzzy +msgid "base" +msgstr "Base" + +msgid "Valid" +msgstr "Valide" + +msgid "hours" +msgstr "heures" + +msgid "Start checking at %s\n" +msgstr "Démarrage du controle à %s\n" + +msgid "D/L Time" +msgstr "Durée D/L" + +msgid "Base" +msgstr "Base" + +msgid "seconds" +msgstr "secondes" + +msgid "URL" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "URL is null or empty" +msgstr "L'URL est nulle ou vide" + +msgid " in %d links" +msgstr " dans %d liens" + +msgid " errors" +msgstr " erreurs" + +msgid "Info" +msgstr "" + +msgid "illegal recursionlevel number %d" +msgstr "valeur du niveau de récursivité %d illégal" + +msgid "%.3f seconds" +msgstr "%.3f secondes" + +msgid "Execute 'linkchecker -h' for help\n" +msgstr "Exécuter 'linkchecker -h' pour obtenir l'aide\n" + +msgid "HTTP 301 (moved permanent) encountered: you should update this link" +msgstr "HTTP 301 (déplacé) rencontré: vous devez mettre à jour ce lien" + +#, fuzzy +msgid "checktime" +msgstr "Durée d'Analyse" + #, fuzzy msgid "" "USAGE\tlinkchecker [options] file-or-url...\n" @@ -91,7 +195,7 @@ msgid "" " ~/.linkcheckerrc and then /etc/linkcheckerrc\n" " (under Windows \\linkcheckerrc).\n" "-F type[/filename], --file-output=type[/filename]\n" -" Same as output, but write to a file linkchecker-out.\n" +" Same as -o, but write to a file linkchecker-out.\n" " or if specified. If the file already exists, it\n" " is overwritten. You can specify this option more than once.\n" " There is no file output for the blacklist logger. Default is\n" @@ -216,110 +320,6 @@ msgstr "" " 'Oracle Application Server error'.\n" " This option implies -w.\n" -msgid ", line " -msgstr ", ligne " - -msgid "url" -msgstr "" - -msgid "None of the mail hosts for %s accepts an SMTP connection: %s" -msgstr "Aucun des hôtes de messagerie pour %s n'accepte de connection SMTP: %s" - -msgid "name" -msgstr "" - -msgid "%.3f seconds\n" -msgstr "%.3f secondes\n" - -msgid "realurl" -msgstr "" - -msgid "" -"LinkChecker Online Error
Error
The LinkChecker Online script has " -"encountered an error. Please ensure that your provided URL link begins with " -"http:// and contains only these characters: A-Za-z0-9./_~-" -"

Errors are logged.
" -msgstr "" - -msgid "No adresses found" -msgstr "Aucune adresse trouvée" - -msgid "created by %s at %s\n" -msgstr "" - -msgid " found\n" -msgstr " trouvé\n" - -msgid "1 error" -msgstr "1 erreur" - -msgid "Error" -msgstr "Erreur" - -msgid "1 warning, " -msgstr "1 avertissement, " - -msgid "info" -msgstr "" - -#, fuzzy -msgid "base" -msgstr "Base" - -msgid "Valid" -msgstr "Valide" - -msgid "hours" -msgstr "heures" - -msgid "Start checking at %s\n" -msgstr "Démarrage du controle à %s\n" - -msgid "D/L Time" -msgstr "Durée D/L" - -msgid "Base" -msgstr "Base" - -msgid "seconds" -msgstr "secondes" - -msgid "URL" -msgstr "" - -msgid "Name" -msgstr "" - -msgid "URL is null or empty" -msgstr "L'URL est nulle ou vide" - -msgid " in %d links" -msgstr " dans %d liens" - -msgid " errors" -msgstr " erreurs" - -msgid "Info" -msgstr "" - -msgid "illegal recursionlevel number %d" -msgstr "valeur du niveau de récursivité %d illégal" - -msgid "%.3f seconds" -msgstr "%.3f secondes" - -msgid "Execute 'linkchecker -h' for help\n" -msgstr "Exécuter 'linkchecker -h' pour obtenir l'aide\n" - -msgid "HTTP 301 (moved permanent) encountered: you should update this link" -msgstr "HTTP 301 (déplacé) rencontré: vous devez mettre à jour ce lien" - -#, fuzzy -msgid "checktime" -msgstr "Durée d'Analyse" - msgid "dltime" msgstr "" diff --git a/setup.py b/setup.py index 7d23d17e..ef5b34b9 100755 --- a/setup.py +++ b/setup.py @@ -22,10 +22,13 @@ from distutils.dist import Distribution from distutils.extension import Extension from distutils.command.install import install from distutils.command.install_data import install_data +from distutils.command.build_scripts import build_scripts,first_line_re from distutils.command.config import config from distutils import util from distutils.file_util import write_file -import os,string,re +from distutils.dep_util import newer + +import os,string,re,sys class MyInstall(install): @@ -66,37 +69,6 @@ class MyInstall(install): print " %s: %s" % (opt_name, val) -class MyInstallData(install_data): - """My own data installer to handle .man pages""" - def run (self): - self.mkpath(self.install_dir) - for f in self.data_files: - if type(f) == StringType: - # it's a simple file, so copy it - if self.warn_dir: - self.warn("setup script did not provide a directory for " - "'%s' -- installing right in '%s'" % - (f, self.install_dir)) - self._install_file(f, self.install_dir) - else: - # it's a tuple with path to install to and a list of files - dir = f[0] - if not os.path.isabs(dir): - dir = os.path.join(self.install_dir, dir) - elif self.root: - dir = change_root(self.root, dir) - self.mkpath(dir) - for data in f[1]: - self._install_file(data, dir) - - def _install_file(self, filename, dirname): - (out, _) = self.copy_file(filename, dirname) - # match for man pages .[0-9] - if re.search(r'/man/.+\.\d$', out): - out = out+".gz" - self.outfiles.append(out) - - class MyConfig(config): user_options = config.user_options + [ ('ssl-include-dirs=', None, @@ -171,7 +143,7 @@ class MyDistribution(Distribution): self.announce("bdist_wininst command found on non-Windows " "platform. Disabling SSL compilation") elif _linkchecker_configdata.have_ssl: - self.ext_modules = [Extension('linkcheckssl', + self.ext_modules = [Extension('linkcheckssl.ssl', ['linkcheckssl/ssl.c'], include_dirs=_linkchecker_configdata.ssl_include_dirs, library_dirs=_linkchecker_configdata.ssl_library_dirs, @@ -192,6 +164,67 @@ class MyDistribution(Distribution): util.execute(write_file, (filename, data), "creating %s" % filename, self.verbose>=1, self.dry_run) +class my_build_scripts(build_scripts): + + description = "\"build\" scripts (copy and fixup #! line)" + + user_options = [ + ('build-dir=', 'd', "directory to \"build\" (copy) to"), + ('force', 'f', "forcibly build everything (ignore file timestamps"), + ] + + boolean_options = ['force'] + + + def copy_scripts(self): + """patched because of a bug""" + outfiles = [] + self.mkpath(self.build_dir) + for script in self.scripts: + adjust = 0 + outfile = os.path.join(self.build_dir, os.path.basename(script)) + + if not self.force and not newer(script, outfile): + self.announce("not copying %s (output up-to-date)" % script) + continue + + # Always open the file, but ignore failures in dry-run mode -- + # that way, we'll get accurate feedback if we can read the + # script. + try: + f = open(script, "r") + except IOError: + if not self.dry_run: + raise + f = None + else: + first_line = f.readline() + if not first_line: + self.warn("%s is an empty file (skipping)" % script) + continue + + match = first_line_re.match(first_line) + if match: + adjust = 1 + post_interp = match.group(1) or "" + + if adjust: + self.announce("copying and adjusting %s -> %s" % + (script, self.build_dir)) + if not self.dry_run: + outf = open(outfile, "w") + outf.write("#!%s%s\n" % + (os.path.normpath(sys.executable), post_interp)) + outf.writelines(f.readlines()) + outf.close() + if f: + f.close() + else: + f.close() + self.copy_file(script, outfile) + + # copy_scripts () + myname = "Bastian Kleineidam" myemail = "calvin@users.sourceforge.net" @@ -223,7 +256,7 @@ o a (Fast)CGI web interface (requires HTTP server) distclass = MyDistribution, cmdclass = {'config': MyConfig, 'install': MyInstall, - 'install_data': MyInstallData, + 'build_scripts': my_build_scripts, }, packages = ['','DNS','linkcheck','linkcheckssl'], scripts = ['linkchecker'], diff --git a/test/output/test_ftp b/test/output/test_ftp index 4150991b..ac14e9ef 100644 --- a/test/output/test_ftp +++ b/test/output/test_ftp @@ -4,13 +4,13 @@ valid url ftp:/ftp.debian.org/pub error url ftp://ftp.debian.org/pub -info 220 ProFTPD Server (ftp1.sourceforge.net) +info 220 ProFTPD 1.2.0pre10 Server (ftp1.sourceforge.net) [216.136.171.195] valid url ftp://ftp.debian.org//pub -info 220 ProFTPD Server (ftp1.sourceforge.net) +info 220 ProFTPD 1.2.0pre10 Server (ftp1.sourceforge.net) [216.136.171.195] valid url ftp://ftp.debian.org////////pub -info 220 ProFTPD Server (ftp1.sourceforge.net) +info 220 ProFTPD 1.2.0pre10 Server (ftp1.sourceforge.net) [216.136.171.195] valid url ftp:///ftp.debian.org/pub cached diff --git a/test/output/test_http b/test/output/test_http index 36bb782b..cd9a0358 100644 --- a/test/output/test_http +++ b/test/output/test_http @@ -43,6 +43,13 @@ url HTTP://WWW.HEISE.DE cached name should be cached valid +url http://www.heise.de/?quoted=ü +name html entities +valid +url http://nocheckin +name no check because of comment --> +no beginning quote +error url illegalquote1 name no beginning quote error