From: David Reitter Date: Fri, 14 Nov 2014 12:22:01 +0000 (-0500) Subject: Compress publicsuffix file to save space X-Git-Tag: emacs-25.0.90~2635^2~473 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c28ef9a4662324fe77910e6c82b72cef0c2aa7df;p=emacs.git Compress publicsuffix file to save space * url-domsuf.el (url-domsuf-parse-file): Read compressed publicsuffix file if available. * Makefile.in (install-arch-indep): Compress publicsuffix.txt file. --- diff --git a/ChangeLog b/ChangeLog index 174fe6a3d41..92c39959689 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-11-14 David Reitter + + * Makefile.in (install-arch-indep): Compress publicsuffix.txt file. + 2014-11-13 Lars Magne Ingebrigtsen * .gitignore: Copy over sufficient ignorable files from the old diff --git a/Makefile.in b/Makefile.in index 8f5cacbfeb5..25d2a08d907 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,7 +259,7 @@ MKDIR_P = @MKDIR_P@ # Create a link to a file in the same directory as the target. LN_S_FILEONLY = @LN_S_FILEONLY@ -# We use gzip to compress installed .el files. +# We use gzip to compress installed .el and some .txt files. GZIP_PROG = @GZIP_PROG@ # ============================= Targets ============================== @@ -600,11 +600,12 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} subdir="$(DESTDIR)${datadir}/emacs/site-lisp" ; \ ${write_subdir} || true [ -z "${GZIP_PROG}" ] || { \ - echo "Compressing *.el ..." && \ + echo "Compressing *.el etc. ..." && \ cd "$(DESTDIR)${lispdir}" && \ for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \ ${GZIP_PROG} -9n "$$f"; \ done; \ + ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \ } -chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS} diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 13628773137..1be4ca70a80 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2014-11-14 David Reitter + + * url-domsuf.el (url-domsuf-parse-file): Read compressed + publicsuffix file if available. + 2014-11-05 Teodor Zlatanov * url-http.el (url-user-agent): New variable, can be function or diff --git a/lisp/url/url-domsuf.el b/lisp/url/url-domsuf.el index 365cf561ae2..b7f92597e2f 100644 --- a/lisp/url/url-domsuf.el +++ b/lisp/url/url-domsuf.el @@ -32,8 +32,12 @@ (defun url-domsuf-parse-file () (with-temp-buffer - (insert-file-contents - (expand-file-name "publicsuffix.txt" data-directory)) + (with-auto-compression-mode + (insert-file-contents + (let* ((suffixfile (expand-file-name "publicsuffix.txt" data-directory)) + (compressed-file (concat suffixfile ".gz"))) + (or (and (file-readable-p compressed-file) compressed-file) + suffixfile)))) (let ((domains nil) domain exception) (while (not (eobp))