From 63d0b44744f4925e9c4fbb6e310289de0e76c2f0 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 11 Dec 2015 22:40:13 -0500 Subject: [PATCH] fix psl_builtin_outdated() and update psl --print-info and --version (pulled from upstream) --- debian/changelog | 2 ++ .../0002-Fix-psl_builtin_outdated.patch | 25 ++++++++++++++++ ...end-tools-psl-print-info-and-version.patch | 29 +++++++++++++++++++ debian/patches/series | 2 ++ 4 files changed, 58 insertions(+) create mode 100644 debian/patches/0002-Fix-psl_builtin_outdated.patch create mode 100644 debian/patches/0003-Extend-tools-psl-print-info-and-version.patch diff --git a/debian/changelog b/debian/changelog index fa854fa..939abf1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ libpsl (0.11.0-2) unstable; urgency=medium * Recommend the publicsuffix package. + * fix psl_builtin_outdated() and update psl --print-info and --version + (pulled from upstream) -- Daniel Kahn Gillmor Fri, 11 Dec 2015 22:34:03 -0500 diff --git a/debian/patches/0002-Fix-psl_builtin_outdated.patch b/debian/patches/0002-Fix-psl_builtin_outdated.patch new file mode 100644 index 0000000..8b4c04f --- /dev/null +++ b/debian/patches/0002-Fix-psl_builtin_outdated.patch @@ -0,0 +1,25 @@ +From: =?utf-8?q?Tim_R=C3=BChsen?= +Date: Sun, 27 Sep 2015 19:14:13 +0200 +Subject: Fix psl_builtin_outdated() + +(amended by dkg for the proper logic) +--- + src/psl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/psl.c b/src/psl.c +index e9bcae2..39ef107 100644 +--- a/src/psl.c ++++ b/src/psl.c +@@ -973,9 +973,9 @@ int psl_builtin_outdated(void) + struct stat st; + + if (stat(_psl_filename, &st) == 0 && st.st_mtime > _psl_file_time) +- return 0; ++ return 1; + +- return 1; ++ return 0; + } + + /** diff --git a/debian/patches/0003-Extend-tools-psl-print-info-and-version.patch b/debian/patches/0003-Extend-tools-psl-print-info-and-version.patch new file mode 100644 index 0000000..a1e0d19 --- /dev/null +++ b/debian/patches/0003-Extend-tools-psl-print-info-and-version.patch @@ -0,0 +1,29 @@ +From: =?utf-8?q?Tim_R=C3=BChsen?= +Date: Sun, 27 Sep 2015 19:14:58 +0200 +Subject: Extend tools/psl --print-info and --version + +--- + tools/psl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/psl.c b/tools/psl.c +index 6790efe..fb3972c 100644 +--- a/tools/psl.c ++++ b/tools/psl.c +@@ -117,7 +117,7 @@ int main(int argc, const char *const *argv) + usage(0, stdout); + } + else if (!strcmp(*arg, "--version")) { +- printf("psl %s\n", PACKAGE_VERSION); ++ printf("psl %s (0x%06x)\n", PACKAGE_VERSION, psl_check_version_number(0)); + printf("libpsl %s\n", psl_get_version()); + printf("\n"); + printf("Copyright (C) 2014-2015 Tim Ruehsen\n"); +@@ -214,6 +214,7 @@ int main(int argc, const char *const *argv) + printf("builtin compile time: %ld (%s)\n", psl_builtin_compile_time(), time2str(psl_builtin_compile_time())); + printf("builtin file time: %ld (%s)\n", psl_builtin_file_time(), time2str(psl_builtin_file_time())); + printf("builtin SHA1 file hash: %s\n", psl_builtin_sha1sum()); ++ printf("builtin outdated: %d\n", psl_builtin_outdated()); + } else + printf("No builtin PSL data available\n"); + } diff --git a/debian/patches/series b/debian/patches/series index 1dbcd19..20fff9a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,3 @@ 0001-remove-git-submodules.patch +0002-Fix-psl_builtin_outdated.patch +0003-Extend-tools-psl-print-info-and-version.patch