aboutsummaryrefslogtreecommitdiff
path: root/system/linkchecker
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-04 07:20:23 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-04 07:20:23 +0700
commit40c0964649707c8996e4b7556877496b3d2b6337 (patch)
tree414985e821e610e1b230b9799f19910bf65ec62f /system/linkchecker
parentfca87de0a808d96e38f202b5c12837fcc6d57737 (diff)
system/linkchecker: Fix python requests version check.
Thanks to Cristiano Urban for reporting. Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/linkchecker')
-rw-r--r--system/linkchecker/fix-python-requests.patch45
-rw-r--r--system/linkchecker/linkchecker.SlackBuild8
2 files changed, 51 insertions, 2 deletions
diff --git a/system/linkchecker/fix-python-requests.patch b/system/linkchecker/fix-python-requests.patch
new file mode 100644
index 0000000000000..71d6be5c63feb
--- /dev/null
+++ b/system/linkchecker/fix-python-requests.patch
@@ -0,0 +1,45 @@
+--- LinkChecker-9.3/linkcheck/__init__.py.orig 2014-07-16 12:34:58.000000000 +0700
++++ LinkChecker-9.3/linkcheck/__init__.py 2017-01-04 07:14:54.662953769 +0700
+@@ -24,10 +24,17 @@
+ # Needs Python >= 2.7.2 which fixed http://bugs.python.org/issue11467
+ if not (hasattr(sys, 'version_info') or
+ sys.version_info < (2, 7, 2, 'final', 0)):
+- raise SystemExit("This program requires Python 2.7.2 or later.")
++ import platform
++ version = platform.python_version()
++ raise SystemExit("This program requires Python 2.7.2 or later instead of %s." % version)
++# require a reasonably recent requests module: 2.4.0 from 2014-08-29
+ import requests
+-if requests.__version__ <= '2.2.0':
+- raise SystemExit("This program requires Python requests 2.2.0 or later.")
++# PEP 396 has only version strings, bummer! PEP 386 is also not helpful.
++requests_version = requests.__version__.split('.')
++# Depends on the version scheme of Python requests
++if int(requests_version[0]) < 2 or \
++ (int(requests_version[0]) == 2 and int(requests_version[1]) < 4):
++ raise SystemExit("This program requires Python requests 2.4.0 or later instead of %s." % requests.__version__)
+
+ import os
+ # add the custom linkcheck_dns directory to sys.path
+@@ -45,7 +52,6 @@
+ LOG_CMDLINE,
+ LOG_CHECK,
+ LOG_CACHE,
+- LOG_GUI,
+ LOG_THREAD,
+ LOG_PLUGIN,
+ )
+@@ -65,11 +71,11 @@
+ return configdata.install_data
+
+
+-class LinkCheckerError (StandardError):
++class LinkCheckerError(Exception):
+ """Exception to be raised on linkchecker-specific check errors."""
+ pass
+
+-class LinkCheckerInterrupt (StandardError):
++class LinkCheckerInterrupt(Exception):
+ """Used for testing."""
+ pass
+
diff --git a/system/linkchecker/linkchecker.SlackBuild b/system/linkchecker/linkchecker.SlackBuild
index 8d15dd0bdd16f..6e7375b2b9a11 100644
--- a/system/linkchecker/linkchecker.SlackBuild
+++ b/system/linkchecker/linkchecker.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for linkchecker
-# Copyright 2013-2016 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
+# Copyright 2013-2017 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@
PRGNAM=linkchecker
SRCNAM=LinkChecker
VERSION=${VERSION:-9.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -70,6 +70,10 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Fix python requests version check
+# https://github.com/wummel/linkchecker/commit/c2ce810c3fb00b895a841a7be6b2e78c64e7b042
+patch -p1 < $CWD/fix-python-requests.patch
+
python setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \