diff --git a/NEWS b/NEWS index 3d2667af..5fda9a28 100644 --- a/NEWS +++ b/NEWS @@ -71,6 +71,7 @@ Miscellaneous: * gzip_read: always call gzclearerr * bug 816: convert entity references in input/@value only once * bug 916: if a mailcap entry has no %s, provide the file as stdin +* bug 744: don't change ``//'' to ``/'' in URIs * bug 766: speed up CSS * bug 355: add documents displayed via ``What to do'' dialog to the global history @@ -125,7 +126,7 @@ Build system and compile-time errors (ignore if you don't build ELinks): * enhancement: avoid compilation of vernum.c in 'make install' * enhancement: make uninstall * experimental enhancements: --with-python=DIRECTORY, --with-gc=DIRECTORY -* experimental enhancement: native Win32 port +* experimental enhancement: Win32 port (build with MinGW MSYS) Changes in the experimental ECMAScript support: diff --git a/autogen.sh b/autogen.sh index f1e9f900..d87f884d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -21,7 +21,8 @@ echo timestamp > stamp-h.in echo autoconf... autoconf -echo config.cache... +echo config.cache, autom4te.cache... rm -f config.cache +rm -rf autom4te.cache echo done diff --git a/config/m4/win32.m4 b/config/m4/win32.m4 index d673041d..18296e51 100644 --- a/config/m4/win32.m4 +++ b/config/m4/win32.m4 @@ -14,7 +14,7 @@ AC_DEFUN([EL_CONFIG_OS_WIN32], EL_RESTORE_FLAGS fi - AC_CHECK_HEADERS(windows.h) + AC_CHECK_HEADERS(windows.h ws2tcpip.h) # TODO: Check this? # TODO: Check -lws2_32 for IPv6 support diff --git a/contrib/mkdist b/contrib/mkdist old mode 100644 new mode 100755 index 0ae0b7b1..0c8d8d1d --- a/contrib/mkdist +++ b/contrib/mkdist @@ -2,11 +2,21 @@ # # This script can be used by a cron to generate snapshots. # For example, use: -# 35 0 * * * mkdist elinks-0.11 0.11 >>mkdist.log 2>&1 -# 40 0 * * * mkdist HEAD 0.12 >>mkdist.log 2>&1 +# 35 0 * * * mkdist -r elinks-0.11 -l 0.11 -s >>mkdist.log 2>&1 +# 40 0 * * * mkdist -r HEAD -l 0.12 -s >>mkdist.log 2>&1 # -# To generate a release (which doesn't have a date in the -# top-level directory) also pass -r as the third parameter. +# Options: +# -g GIT_DIR Git repository from which this script exports ELinks. +# May be given in the environment instead. +# -r REVISION Git revision to be exported from the repository. +# -l LABEL User-friendly name of the branch or release. +# This ends up in the name of the tar file, and in the +# name of the directory it contains. +# -s Generate a snapshot (which has a date in the top-level +# directory). +# -d DOCDIR Copy prebuilt documentation from DOCDIR. +# -o OUTDIR Place the output files in OUTDIR. Defaults to the +# current directory. # set -x @@ -15,64 +25,118 @@ echo "Date: $(date)" echo "Args: $*" echo "-------------------------------------------------" -ub=$1 -lb=$2 +# Variables used in this script: +# $GIT_DIR = option -g GIT_DIR; passed in environment to Git +# $OPTARG = Bash special: argument of the option being parsed +# $OPTIND = Bash special: index of argument to be parsed next +# $commit = commit ID corresponding to $rev +# $docdir = option -d DOCDIR +# $label = option -l LABEL +# $opt = option letter being parsed, or '?' on error +# $outdir = option -o OUTDIR +# $rev = option -r REVISION +# $snap = option -s +# $tarbasename = name of the tar file without .tar.* extensions +# $tartopdir = name of the top directory within the tar file +# $tmpdir = temporary directory created by this script -GIT_DIR="elinks-repo-directory" -DOC_DIR="" # Leave empty for no doc dir -TMP_DIR="/tmp/elinks-git.$$" -TAR_DIR="elinks-snapshot-directory" +rev= +label= +snap= +docdir= +outdir=. +while getopts "g:r:l:sd:o:" opt +do + case "$opt" in + (g) GIT_DIR=$OPTARG ;; + (r) rev=$OPTARG ;; + (l) label=$OPTARG ;; + (s) snap=1 ;; + (d) docdir=$OPTARG ;; + (o) outdir=$OPTARG ;; + ("?") exit 1 ;; + (*) echo >&2 "$0:$LINENO: bug found" + exit 1 ;; + esac +done -[ "$ub" ] || exit 1 -[ "$lb" ] || exit 1 - -if [ "$3" != "-r" ]; then - ver=$lb-`date +%Y%m%d` - c="-current"; -else - ver=$lb; - c=""; +if [ $OPTIND -le $# ] +then + echo >&2 "$0: too many non-option arguments" + exit 1 fi -mkdir "$TMP_DIR -cd "$TMP_DIR" - -GIT_DIR="$GIT_DIR" cg-export -r "$ub" "$TMP_DIR"/elinks" - -cd elinks - -./autogen.sh -./configure - -if [ "$ub" = "REL_0_10" ]; then - make dist - tar xfz elinks-$lb*.tar.gz - cd elinks-$ub* -else - make -C po +if [ -z "$GIT_DIR" ] +then + echo >&2 "$0: Must specify -g GIT_DIR option" + exit 1 +fi +if [ -z "$outdir" ] +then + echo >&2 "$0: Must specify -o OUTDIR option" + exit 1 +fi +if [ -z "$rev" ] +then + echo >&2 "$0: Must specify -r REVISION option" + exit 1 +fi +if [ -z "$label" ] +then + label=$rev fi -if test -n "$DOC_DIR"; then - mkdir doc/html - cp -r "$DOC_DIR"/*.html* doc/html +commit=$(GIT_DIR=$GIT_DIR cg-object-id -c "$rev") || exit 1 + +if [ "$snap" ] +then + tartopdir=elinks-$label-$(date +%Y%m%d) + tarbasename=elinks-current-$label +else + tartopdir=elinks-$label + tarbasename=elinks-$label +fi + +tmpdir=$(mktemp -d -t elinks-dist-XXXXXXXX) || exit 1 + +# To make it easier to compare build logs, put the source first in an +# "elinks" directory, and only move to "$tartopdir" when finished. + +GIT_DIR=$GIT_DIR cg-export -r "$rev" -- "$tmpdir/elinks" +mkdir -- "$tmpdir/elinks/.git" +printf "%s\n" "$commit" > "$tmpdir/elinks/.git/HEAD" + +(set -e + cd -- "$tmpdir/elinks" + ./autogen.sh + mkdir build + cd build + ../configure + make -C po + mv po/*.gmo ../po/ + mv contrib/elinks.spec ../contrib/ +) || exit 1 + +if [ -n "$docdir" ]; then + mkdir -- "$tmpdir/elinks/doc/html" + cp -r -- "$docdir"/*.html* "$tmpdir/elinks/doc/html/" # mkdir doc/pdf - # cp "$DOC_DIR"/*.pdf doc/pdf + # cp "$docdir"/*.pdf doc/pdf fi -cd .. +rm -rf -- "$tmpdir/elinks/build" +mv -- "$tmpdir/elinks" "$tmpdir/$tartopdir" -if [ "$c" ]; then - dir=`ls .` - mv $dir elinks-$ver -fi - - -tar cfz elinks$c-$lb.tar.gz elinks-$ver && \ -mv elinks$c-$lb.tar.gz "$TAR_DIR" && \ -(cd "$TAR_DIR" && md5sum elinks$c-$lb.tar.gz > elinks$c-$lb.tar.gz.md5) - -tar cfj elinks$c-$lb.tar.bz2 elinks-$ver && \ -mv elinks$c-$lb.tar.bz2 "$TAR_DIR" && \ -(cd "$TAR_DIR" && md5sum elinks$c-$lb.tar.bz2 > elinks$c-$lb.tar.gz.md5) - -rm -rf "$TMP_DIR" +(set -e + cd -- "$tmpdir" + tar cf "$tarbasename.tar" "$tartopdir" + md5sum --binary -- "$tarbasename.tar" > "$tarbasename.md5" + bzip2 --keep -- "$tarbasename.tar" + gzip -9 -- "$tarbasename.tar" + md5sum --binary -- "$tarbasename.tar.gz" "$tarbasename.tar.bz2" >> "$tarbasename.md5" +) || exit 1 + +mv -- "$tmpdir/$tarbasename.tar.gz" "$outdir" +mv -- "$tmpdir/$tarbasename.tar.bz2" "$outdir" +mv -- "$tmpdir/$tarbasename.md5" "$outdir" +rm -rf -- "$tmpdir" diff --git a/contrib/proxy/.gitignore b/contrib/proxy/.gitignore new file mode 100644 index 00000000..828fea7e --- /dev/null +++ b/contrib/proxy/.gitignore @@ -0,0 +1,3 @@ +gen +proxy.py +*.http diff --git a/contrib/proxy/gen.c b/contrib/proxy/gen.c index 1190079b..59d1b2b1 100644 --- a/contrib/proxy/gen.c +++ b/contrib/proxy/gen.c @@ -121,10 +121,10 @@ dicts(FILE *f) fprintf(f, "slownik = {\n"); for (i = 0; i < counter - 1; i++) { - fprintf(f, "\t'http://%s%s' : '%d.txt',\n", tab[i].host, tab[i].string, i); + fprintf(f, "\t'http://%s%s' : '%d.http',\n", tab[i].host, tab[i].string, i); } for (; i < counter; i++) { - fprintf(f, "\t'http://%s%s' : '%d.txt'\n", tab[i].host, tab[i].string, i); + fprintf(f, "\t'http://%s%s' : '%d.http'\n", tab[i].host, tab[i].string, i); } fprintf(f, "}\n\n"); } @@ -138,7 +138,7 @@ save(void) for (i = 0; i < counter; i++) { char buf[12]; - snprintf(buf, 12, "%d.txt", i); + snprintf(buf, 12, "%d.http", i); f = fopen(buf, "w"); if (!f) return; diff --git a/doc/Makefile b/doc/Makefile index c1943aca..ed9b6fda 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,7 +4,7 @@ include $(top_builddir)/Makefile.config SUBDIRS = man # A little trick to simplify some of the rules. -VPATH = $(builddir):$(srcdir):$(top_srcdir)/contrib/perl:$(top_srcdir)/po/perl +VPATH = $(builddir):$(srcdir):$(top_srcdir)/contrib/perl docdir = $(datadir)/doc @@ -43,11 +43,9 @@ HTML_DOCS-$(CONFIG_POD2HTML) += \ perl.html \ perl-hooks.html -# Don't install these documents, because the corresponding scripts -# are not installed either. However, generating them may be useful. -HTML_DOCS_NOINSTALL-$(CONFIG_POD2HTML) += \ - perl-check-accelerator-conflicts.html \ - perl-gather-accelerator-contexts.html +# We don't nowadays run pod2html on the po/perl/ scripts, because +# "make install" does not install them and they do not have the .pl +# suffix expected by the pod2html rule below. MAN_DOCS-$(CONFIG_XMLTO) += \ elinks.1 \ @@ -64,11 +62,10 @@ PDF_DOCS-$(CONFIG_JW) += \ MAN_DOCS = $(MAN_DOCS-yes) HTML_DOCS = $(HTML_DOCS-yes) -HTML_DOCS_NOINSTALL = $(HTML_DOCS_NOINSTALL-yes) PDF_DOCS = $(PDF_DOCS-yes) txt: $(TXT_DOCS_NOINSTALL) -html: txt $(HTML_DOCS) $(HTML_DOCS_NOINSTALL) +html: txt $(HTML_DOCS) pdf: txt $(PDF_DOCS) man: txt $(MAN_DOCS) @@ -97,7 +94,7 @@ update-man: man $(call ncmd,installdata,elinks.conf.5,$(srcdir)man/man5/)) clean-local: - @$(RM) -r api $(TXT_DOCS_NOINSTALL) $(MAN_DOCS) $(HTML_DOCS) $(HTML_DOCS_NOINSTALL) $(PDF_DOCS) *.tmp *.xml + @$(RM) -r api $(TXT_DOCS_NOINSTALL) $(MAN_DOCS) $(HTML_DOCS) $(PDF_DOCS) *.tmp *.xml # TODO: perl.pod should be pod2ized during make install. --pasky install-local: diff --git a/po/Makefile b/po/Makefile index bc51f977..29735600 100644 --- a/po/Makefile +++ b/po/Makefile @@ -53,7 +53,7 @@ $(srcdir)$(POTFILES_ABS_LIST): $(POTFILES_REL) find src/ -type f -name '*.[ch]' -o -name options.inc -o -name 'actions-*.inc' | sort ) \ > $(srcdir)$(POTFILES_ABS_LIST) -$(srcdir)$(PACKAGE).pot: $(srcdir)$(POTFILES_ABS_LIST) $(srcdir)perl/gather-accelerator-contexts.pl +$(srcdir)$(PACKAGE).pot: $(srcdir)$(POTFILES_ABS_LIST) $(srcdir)perl/msgaccel-prepare $(XGETTEXT) --default-domain=$(PACKAGE) \ --directory=$(top_srcdir) \ --add-comments --language=C \ @@ -77,7 +77,7 @@ $(srcdir)$(PACKAGE).pot: $(srcdir)$(POTFILES_ABS_LIST) $(srcdir)perl/gather-acce --flag=N__:1:pass-c-format \ -f $(srcdir)$(POTFILES_ABS_LIST) \ && test -f $(PACKAGE).po \ - && $(PERL) -I"$(srcdir)perl" $(srcdir)perl/gather-accelerator-contexts.pl -S"$(top_srcdir)" $(PACKAGE).po \ + && $(PERL) -I"$(srcdir)perl" $(srcdir)perl/msgaccel-prepare -S"$(top_srcdir)" $(PACKAGE).po \ && mv -f $(PACKAGE).po $(srcdir)$(PACKAGE).pot @@ -111,7 +111,7 @@ check-po: @-$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(GMOFILES))), \ echo -n "$(lang): "; \ $(GMSGFMT) --check --check-accelerators="~" --verbose --statistics -o /dev/null $(srcdir)$(lang).po; \ - $(PERL) -I"$(srcdir)perl" $(srcdir)perl/check-accelerator-conflicts.pl $(srcdir)$(lang).po; \ + $(PERL) -I"$(srcdir)perl" $(srcdir)perl/msgaccel-check $(srcdir)$(lang).po; \ ) ### Installation and distribution diff --git a/po/README b/po/README index 88688f12..0ff0579e 100644 --- a/po/README +++ b/po/README @@ -166,131 +166,8 @@ well, especially Last-Translator and PO-Revision-Date fields. -------------------- First set Plural-Forms: header (msgid "" at top of .po file) to some correct -value, depending on language. - -To help you in this, here is an excerpt from GNU gettext documentation: - -Only one form: - Some languages only require one single form. There is no distinction - between the singular and plural form. An appropriate header entry - would look like this: - - Plural-Forms: nplurals=1; plural=0; - - Languages with this property include: - - Finno-Ugric family - Hungarian - Asian family - Japanese, Korean - Turkic/Altaic family - Turkish - -Two forms, singular used for one only: - This is the form used in most existing programs since it is what English - is using. A header entry would look like this: - - Plural-Forms: nplurals=2; plural=n != 1; - - (Note: this uses the feature of C expressions that boolean expressions - have to value zero or one.) - - Languages with this property include: - - Germanic family - Danish, Dutch, English, German, Norwegian, Swedish - Finno-Ugric family - Estonian, Finnish - Latin/Greek family - Greek - Semitic family - Hebrew - Romanic family - Italian, Portuguese, Spanish - Artificial - Esperanto - -Two forms, singular used for zero and one: - Exceptional case in the language family. The header entry would be: - - Plural-Forms: nplurals=2; plural=n>1; - - Languages with this property include: - - Romanic family - French, Brazilian Portuguese - -Three forms, special case for zero: - The header entry would be: - - Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2; - - Languages with this property include: - - Baltic family - Latvian - -Three forms, special cases for one and two: - The header entry would be: - - Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2; - - Languages with this property include: - - Celtic - Gaeilge (Irish) - -Three forms, special case for numbers ending in 1[2-9]: - The header entry would look like this: - - Plural-Forms: nplurals=3; \ - plural=n%10==1 && n%100!=11 ? 0 : \ - n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2; - - Languages with this property include: - - Baltic family - Lithuanian - -Three forms, special cases for numbers ending in 1 and 2, 3, 4, -except those ending in 1[1-4]: - The header entry would look like this: - - Plural-Forms: nplurals=3; \ - plural=n%10==1 && n%100!=11 ? 0 : \ - n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; - - Languages with this property include: - - Slavic family - Croatian, Czech, Russian, Slovak, Ukrainian - -Three forms, special case for one and some numbers ending in 2, 3, or 4: - The header entry would look like this: - - Plural-Forms: nplurals=3; \ - plural=n==1 ? 0 : \ - n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; - - Languages with this property include: - - Slavic family - Polish - -Four forms, special case for one and all numbers ending in 02, 03, or 04: - The header entry would look like this: - - Plural-Forms: nplurals=4; \ - plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; - - Languages with this property include: - - Slavic family - Slovenian - - -More info at http://www.gnu.org/software/gettext - +value, depending on language. See GNU gettext documentation for details, at +http://www.gnu.org/software/gettext Plural forms will appear like this in .po file: diff --git a/po/perl/README b/po/perl/README index 78c6743d..75b4100d 100644 --- a/po/perl/README +++ b/po/perl/README @@ -21,21 +21,21 @@ When a programmer adds a translatable string to the C source code of ELinks, and the string contains an accelerator, he should also add a special "gettext_accelerator_context" comment that names the menu or dialog box in which the string will be used. See the documentation of -gather-accelerator-contexts.pl for the details. +msgaccel-prepare for the details. -When a programmer or translator runs "make update-po" in the -elinks/po directory, gather-accelerator-contexts.pl reads the -"gettext_accelerator_context" comments in the source files and -generates "accelerator_context" comments in elinks.pot. Then, -msgmerge copies them from elinks.pot to *.po. +When a programmer or translator runs "make update-po" in the elinks/po +directory, msgaccel-prepare reads the "gettext_accelerator_context" +comments in the source files and generates "accelerator_context" +comments in elinks.pot. Then, msgmerge copies them from elinks.pot to +*.po. When a translator edits a *.po file, she does not alter the "accelerator_context" comments. When a translator runs "make check-po" in the elinks/po directory, -check-accelerator-conflicts.pl reads the "accelerator_context" -comments in the *.po file, checks the accelerators in the -translations, and displays any conflicts it finds. +msgaccel-check reads the "accelerator_context" comments in the *.po +file, checks the accelerators in the translations, and displays any +conflicts it finds. FILES @@ -43,12 +43,12 @@ FILES See each file for copying conditions. -gather-accelerator-contexts.pl reads elinks.pot and the source files -to which it refers, and writes a new elinks.pot with information from +msgaccel-prepare reads elinks.pot and the source files to which it +refers, and writes a new elinks.pot with information from "gettext_accelerator_context" comments. -check-accelerator-conflicts.pl reads just one *.po file and scans it -for conflicts. It does not access the C source files. +msgaccel-check reads just one *.po file and scans it for conflicts. +It does not access the C source files. Locale/PO.pm was originally imported from Locale-PO-0.16 on CPAN, and has since been patched to make it more suitable for these scripts. diff --git a/po/perl/check-accelerator-conflicts.pl b/po/perl/msgaccel-check similarity index 83% rename from po/perl/check-accelerator-conflicts.pl rename to po/perl/msgaccel-check index dea809ed..29e01c30 100755 --- a/po/perl/check-accelerator-conflicts.pl +++ b/po/perl/msgaccel-check @@ -7,11 +7,11 @@ use Locale::PO qw(); use Getopt::Long qw(GetOptions :config bundling gnu_compat); use autouse 'Pod::Usage' => qw(pod2usage); -my $VERSION = "1.5"; +my $VERSION = "1.6"; sub show_version { - print "check-accelerator-conflicts.pl $VERSION\n"; + print "msgaccel-check $VERSION\n"; pod2usage({-verbose => 99, -sections => "COPYRIGHT AND LICENSE", -exitval => 0}); } @@ -208,32 +208,31 @@ __END__ =head1 NAME -check-accelerator-conflicts.pl - Scan a PO file for conflicting -accelerator keys. +msgaccel-check - Scan a PO file for conflicting accelerator keys. =head1 SYNOPSIS -B [I