This commit is contained in:
Tim Rühsen 2015-07-14 13:15:49 +02:00
parent f9a1bdcf80
commit 71835fcd44
10 changed files with 18 additions and 10417 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "list"]
path = list
url = https://github.com/publicsuffix/list

View File

@ -1,6 +1,6 @@
# got some hints from https://gitorious.org/openismus-playground/examplelib/source # got some hints from https://gitorious.org/openismus-playground/examplelib/source
SUBDIRS = po include src tools data $(LIBPSL_DOCS) tests SUBDIRS = po include src tools $(LIBPSL_DOCS) tests
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@ -14,4 +14,4 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpsl.pc pkgconfig_DATA = libpsl.pc
EXTRA_DIST = config.rpath LICENSE EXTRA_DIST = config.rpath LICENSE list/public_suffix_list.dat list/tests/test_psl.txt

View File

@ -6,6 +6,12 @@ if test $? -ne 0; then
exit 1 exit 1
fi fi
GIT=`which git 2>/dev/null`
if test $? -ne 0; then
echo "No 'git' found. You must install the git package."
exit 1
fi
# create m4 before gtkdocize # create m4 before gtkdocize
mkdir m4 2>/dev/null mkdir m4 2>/dev/null
@ -21,6 +27,8 @@ else
$GTKDOCIZE || exit $? $GTKDOCIZE || exit $?
fi fi
$GIT submodule init
$GIT submodule update
$AUTORECONF --install --force --symlink || exit $? $AUTORECONF --install --force --symlink || exit $?
echo echo

View File

@ -231,14 +231,14 @@ fi
AC_ARG_WITH(psl-file, AC_ARG_WITH(psl-file,
AC_HELP_STRING([--with-psl-file=[PATH]], [path to PSL file]), AC_HELP_STRING([--with-psl-file=[PATH]], [path to PSL file]),
PSL_FILE=$withval, PSL_FILE=$withval,
PSL_FILE="\$(top_srcdir)/data/effective_tld_names.dat") PSL_FILE="\$(top_srcdir)/list/public_suffix_list.dat")
AC_SUBST(PSL_FILE) AC_SUBST(PSL_FILE)
# Check for custom PSL test file # Check for custom PSL test file
AC_ARG_WITH(psl-testfile, AC_ARG_WITH(psl-testfile,
AC_HELP_STRING([--with-psl-testfile=[PATH]], [path to PSL test file]), AC_HELP_STRING([--with-psl-testfile=[PATH]], [path to PSL test file]),
PSL_TESTFILE=$withval, PSL_TESTFILE=$withval,
PSL_TESTFILE="\$(top_srcdir)/data/test_psl.txt") PSL_TESTFILE="\$(top_srcdir)/list/tests/test_psl.txt")
AC_SUBST(PSL_TESTFILE) AC_SUBST(PSL_TESTFILE)
# check for alloca / alloca.h # check for alloca / alloca.h
@ -252,7 +252,6 @@ AC_CONFIG_FILES([Makefile
src/Makefile src/Makefile
tools/Makefile tools/Makefile
po/Makefile.in po/Makefile.in
data/Makefile
tests/Makefile tests/Makefile
libpsl.pc:libpsl.pc.in]) libpsl.pc:libpsl.pc.in])
AC_OUTPUT AC_OUTPUT

View File

@ -1,3 +0,0 @@
filesdir = $(datadir)/@PACKAGE@
files_DATA = $(PSL_FILE) test_psl.txt
EXTRA_DIST = $(files_DATA)

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/
// null input.
checkPublicSuffix(null, null);
// Mixed case.
checkPublicSuffix('COM', null);
checkPublicSuffix('example.COM', 'example.com');
checkPublicSuffix('WwW.example.COM', 'example.com');
// Leading dot.
checkPublicSuffix('.com', null);
checkPublicSuffix('.example', null);
checkPublicSuffix('.example.com', null);
checkPublicSuffix('.example.example', null);
// Unlisted TLD.
checkPublicSuffix('example', null);
checkPublicSuffix('example.example', 'example.example');
checkPublicSuffix('b.example.example', 'example.example');
checkPublicSuffix('a.b.example.example', 'example.example');
// Listed, but non-Internet, TLD.
//checkPublicSuffix('local', null);
//checkPublicSuffix('example.local', null);
//checkPublicSuffix('b.example.local', null);
//checkPublicSuffix('a.b.example.local', null);
// TLD with only 1 rule.
checkPublicSuffix('biz', null);
checkPublicSuffix('domain.biz', 'domain.biz');
checkPublicSuffix('b.domain.biz', 'domain.biz');
checkPublicSuffix('a.b.domain.biz', 'domain.biz');
// TLD with some 2-level rules.
checkPublicSuffix('com', null);
checkPublicSuffix('example.com', 'example.com');
checkPublicSuffix('b.example.com', 'example.com');
checkPublicSuffix('a.b.example.com', 'example.com');
checkPublicSuffix('uk.com', null);
checkPublicSuffix('example.uk.com', 'example.uk.com');
checkPublicSuffix('b.example.uk.com', 'example.uk.com');
checkPublicSuffix('a.b.example.uk.com', 'example.uk.com');
checkPublicSuffix('test.ac', 'test.ac');
// TLD with only 1 (wildcard) rule.
checkPublicSuffix('cy', null);
checkPublicSuffix('c.cy', null);
checkPublicSuffix('b.c.cy', 'b.c.cy');
checkPublicSuffix('a.b.c.cy', 'b.c.cy');
// More complex TLD.
checkPublicSuffix('jp', null);
checkPublicSuffix('test.jp', 'test.jp');
checkPublicSuffix('www.test.jp', 'test.jp');
checkPublicSuffix('ac.jp', null);
checkPublicSuffix('test.ac.jp', 'test.ac.jp');
checkPublicSuffix('www.test.ac.jp', 'test.ac.jp');
checkPublicSuffix('kyoto.jp', null);
checkPublicSuffix('test.kyoto.jp', 'test.kyoto.jp');
checkPublicSuffix('ide.kyoto.jp', null);
checkPublicSuffix('b.ide.kyoto.jp', 'b.ide.kyoto.jp');
checkPublicSuffix('a.b.ide.kyoto.jp', 'b.ide.kyoto.jp');
checkPublicSuffix('c.kobe.jp', null);
checkPublicSuffix('b.c.kobe.jp', 'b.c.kobe.jp');
checkPublicSuffix('a.b.c.kobe.jp', 'b.c.kobe.jp');
checkPublicSuffix('city.kobe.jp', 'city.kobe.jp');
checkPublicSuffix('www.city.kobe.jp', 'city.kobe.jp');
// TLD with a wildcard rule and exceptions.
checkPublicSuffix('ck', null);
checkPublicSuffix('test.ck', null);
checkPublicSuffix('b.test.ck', 'b.test.ck');
checkPublicSuffix('a.b.test.ck', 'b.test.ck');
checkPublicSuffix('www.ck', 'www.ck');
checkPublicSuffix('www.www.ck', 'www.ck');
// US K12.
checkPublicSuffix('us', null);
checkPublicSuffix('test.us', 'test.us');
checkPublicSuffix('www.test.us', 'test.us');
checkPublicSuffix('ak.us', null);
checkPublicSuffix('test.ak.us', 'test.ak.us');
checkPublicSuffix('www.test.ak.us', 'test.ak.us');
checkPublicSuffix('k12.ak.us', null);
checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us');
checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us');
// IDN labels.
checkPublicSuffix('食狮.com.cn', '食狮.com.cn');
checkPublicSuffix('食狮.公司.cn', '食狮.公司.cn');
checkPublicSuffix('www.食狮.公司.cn', '食狮.公司.cn');
checkPublicSuffix('shishi.公司.cn', 'shishi.公司.cn');
checkPublicSuffix('公司.cn', null);
checkPublicSuffix('食狮.中国', '食狮.中国');
checkPublicSuffix('www.食狮.中国', '食狮.中国');
checkPublicSuffix('shishi.中国', 'shishi.中国');
checkPublicSuffix('中国', null);
// Same as above, but punycoded.
checkPublicSuffix('xn--85x722f.com.cn', 'xn--85x722f.com.cn');
checkPublicSuffix('xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
checkPublicSuffix('www.xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
checkPublicSuffix('shishi.xn--55qx5d.cn', 'shishi.xn--55qx5d.cn');
checkPublicSuffix('xn--55qx5d.cn', null);
checkPublicSuffix('xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
checkPublicSuffix('www.xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
checkPublicSuffix('shishi.xn--fiqs8s', 'shishi.xn--fiqs8s');
checkPublicSuffix('xn--fiqs8s', null);

1
list Submodule

@ -0,0 +1 @@
Subproject commit f1c4849aefa4c61257aba5b595be5d552c99144d

View File

@ -143,7 +143,7 @@ int main(int argc, const char **argv)
if (argc != 3) { if (argc != 3) {
fprintf(stderr, "Usage: psl2c <infile> <outfile>\n"); fprintf(stderr, "Usage: psl2c <infile> <outfile>\n");
fprintf(stderr, " <infile> is the 'effective_tld_names.dat' (aka Public Suffix List), lowercase UTF-8 encoded\n"); fprintf(stderr, " <infile> is the 'public_suffix_list.dat', lowercase UTF-8 encoded\n");
fprintf(stderr, " <outfile> is the the C filename to be generated from <infile>\n"); fprintf(stderr, " <outfile> is the the C filename to be generated from <infile>\n");
return 1; return 1;
} }

View File

@ -21,7 +21,7 @@
* *
* This file is part of the test suite of libpsl. * This file is part of the test suite of libpsl.
* *
* Test psl_is_public_suffix() for all entries in effective_tld_names.dat * Test psl_is_public_suffix() for all entries in public_suffix_list.dat
* *
* Changelog * Changelog
* 19.03.2014 Tim Ruehsen created * 19.03.2014 Tim Ruehsen created