diff --git a/.travis.yml b/.travis.yml index 8ec4f39..9d9bb3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,97 +1,29 @@ -language: c +language: python -env: - global: - - _COMPILE="libtool --mode=compile --tag=CC gcc" - - _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX" - - _INSTALL="libtool --mode=install install -p" - - _LINK="libtool --mode=link --tag=CC gcc" - - _LIBS="-lm -Wl,-E -ldl -lreadline" +sudo: false - - prefix=/usr/local - - bindir=$prefix/bin - - incdir=$prefix/include - - libdir=$prefix/lib +addons: + apt: + packages: + - help2man +env: + global: - _inst=$TRAVIS_BUILD_DIR/_inst - luadir=$_inst/share/lua - luaexecdir=$_inst/lib/lua matrix: - - LUA=lua5.3 - - LUA=lua5.2 - - LUA=lua5.1 - - LUA=luajit + - VLUA="lua=5.3" + - VLUA="lua=5.2" + - VLUA="lua=5.1" + - VLUA="luajit=2.1" + - VLUA="luajit=2.0" before_install: - # Put back the links for libyaml, which are missing on recent Travis VMs - - test -f /usr/lib/libyaml.so || - sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \; - - sudo apt-get install help2man - - # Fetch Lua sources. - - cd $TRAVIS_BUILD_DIR - - 'if test lua5.3 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.3.1.tar.gz | tar xz; - cd lua-5.3.1; - fi' - - 'if test lua5.2 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz; - cd lua-5.2.4; - fi' - - 'if test lua5.1 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz; - cd lua-5.1.5; - fi' - - # Unpack, compile and install Lua. - - 'if test luajit = "$LUA"; then - curl http://luajit.org/download/LuaJIT-2.0.3.tar.gz | tar xz; - cd LuaJIT-2.0.3; - make && sudo make install; - for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do - if test -f /usr/local/include/luajit-2.0/$header; then - sudo ln -s /usr/local/include/luajit-2.0/$header /usr/local/include/$header; - fi; - done; - else - for src in src/*.c; do - test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src; - done; - eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo; - sudo mkdir -p $libdir; - eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la; - - eval $_COMPILE $_CFLAGS -c src/lua.c; - eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS; - sudo mkdir -p $bindir; - eval sudo $_INSTALL $LUA $bindir/$LUA; - - sudo mkdir -p $incdir; - for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do - if test -f src/$header; then - eval sudo $_INSTALL src/$header $incdir/$header; - fi; - done; - fi' - - # Fetch LuaRocks. - - cd $TRAVIS_BUILD_DIR - - 'git clone https://github.com/keplerproject/luarocks.git luarocks-2.2.0' - - cd luarocks-2.2.0 - - git checkout v2.2.0 - - # Compile and install luarocks. - - if test luajit = "$LUA"; then - ./configure --lua-suffix=jit; - else - ./configure; - fi - - 'make build && sudo make install' - - # Tidy up file droppings. - - cd $TRAVIS_BUILD_DIR - - rm -rf lua-5.3.1 lua-5.2.4 lua-5.1.5 LuaJIT-2.0.3 luarocks-2.2.0 + - pip install hererocks + - hererocks here -r^ --$VLUA + - export PATH=$PWD/here/bin:$PATH install: @@ -99,7 +31,7 @@ install: - 'for rock in ansicolors ldoc specl""; do if test -z "$rock"; then break; fi; if luarocks list | grep "^$rock$" >/dev/null; then continue; fi; - sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock; + luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock; done' # Fudge timestamps on release branches. @@ -113,21 +45,19 @@ install: # Build from rockspec, forcing uninstall of older luarocks installed # above when testing the git rockspec, both for enforcing backwards # compatibility by default, and for ease of maintenance. - - if test -f 'lyaml-6.0-1.rockspec'; then - sudo luarocks make 'lyaml-6.0-1.rockspec' LUA="$LUA"; + - if test -f 'lyaml-6.1-1.rockspec'; then + luarocks make 'lyaml-6.1-1.rockspec'; else - sudo luarocks make --force 'lyaml-git-1.rockspec' LUA="$LUA"; + luarocks make --force 'lyaml-git-1.rockspec'; fi - # Clean up files created by root - - sudo git clean -dfx - - sudo rm -rf slingshot /tmp/ldoc - script: # Reconfigure for in-tree test install. - test -f configure || ./bootstrap --verbose - - ./configure --prefix="$_inst" --disable-silent-rules LUA="$LUA" + - LUA=`pwd`/here/bin/lua + LUA_INCLUDE=-I`pwd`/here/include + ./configure --prefix="$_inst" --disable-silent-rules # Verify luarocks installation. - make installcheck || make installcheck V=1 diff --git a/ChangeLog b/ChangeLog index 46dca2d..6e5e33f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,64 @@ -2015-07-27 Gary V. Vaughan +2016-10-08 Gary V. Vaughan + + Release version 6.1 + * NEWS.md: Record release date. + + configury: bump release number to 6.1. + * configure.ac (AC_INIT): Bump release number to 6.1. + * .travis.yml: Regenerate. + + implicit: parse an unquoted null token as lyaml.null + Fixes #13. + * specs/lib_lyaml_spec.yaml (scalars): Specify correct behaviour + with various spellings of 'null'. + (a map): Quote bare null tokens that should be parsed as strings. + * lib/lyaml/implicit.lua (null): Parse an unquoted null token as + lyaml.null. + * NEWS.md (Bug fixes): Update. + +2016-10-07 Gary V. Vaughan + + slingshot: sync with latest upstream. + * slingshot: Update submodule. + * .travis.yml: Regenerate. + * bootstrap: Regenerate. + + configury: rearrange configure.ac macros for better error reporting + If libyaml.so is not in the path, the old order would fall over + during AX_PROG_LUA with an unhelpful failure message. + * configure.ac (AC_PATH_PROG, AX_PROG_LUA, AX_LUA_HEADERS): Move + invocations above LIBYAML checks. + +2016-01-05 Gary V. Vaughan + + maint: bump copyright years. + * bootstrap.conf, configure.ac, ext/yaml/emitter.c, + ext/yaml/lyaml.h, ext/yaml/parser.c, ext/yaml/scanner.c, + ext/yaml/yaml.c, lib/lyaml.lua, lib/lyaml/explicit.lua, + lib/lyaml/functional.lua, lib/lyaml/implicit.lua, local.mk, + slingshot, specs/specs.mk: Add 2016 to copyright years. + + slingshot: update to latest revision for Travis GCE compatibility. + * slingshot: Pull latest upstream. + * .travis.yml: Regenerate. + +2015-10-11 Gary V. Vaughan + + configury: don't let libyaml search affect Lua headers test. + Closes #11. + * configure.ac (AC_SEARCH_LIBS): Save and restore $LIBS contents + around this search, so that -lyaml is not left prepended to + affect later checks. + (lyaml): Store -lyaml in LIBYAML. + * local.mk (ext_yaml_yaml_la_LIBADD): Add $(LIBYAML). + (ext_yaml_yaml_la_CPPFLAGS): Remove unset YAML_INCLUDE. + +2015-07-26 Gary V. Vaughan + + maint: post-release administrivia. + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * ./local.mk (old_NEWS_hash): Auto-update. Release version 6.0 * NEWS.md: Record release date. @@ -31,8 +91,6 @@ variables for intermediate values. Adjust error messages expectations to match reality! -2015-07-26 Gary V. Vaughan - lyaml: ensure lyaml.dump has an equivalent signature to lyaml.load. * lib/lyaml.lua (dump): Accept an option table of options. (Dumper): Normalise options. @@ -194,7 +252,7 @@ https://github.com/gvvaughan/lyaml/issues/7 From Nick Muerdter -2015-07-13 Gary V. Vaughan +2015-07-12 Gary V. Vaughan lyaml: support !!merge key type. Fixes #8. @@ -214,8 +272,6 @@ (parser_mt.load_scalar): Parse !!int tag arguments fully. * NEWS.md (Bug fixes): Update accordingly. -2015-07-12 Gary V. Vaughan - lyaml: load the whole range of !!float arguments fully. * specs/lib_lyaml_spec.yaml (load): Specify more input types for float tag value strings and how they should be loaded. @@ -374,12 +430,12 @@ slingshot: sync with upstream, for release fixes. * slingshot: Sync with upstream. +2014-12-18 Gary V. Vaughan + slingshot: sync with upstream, for rebootstrap subproject fix. * slingshot: Sync with upstream. * bootstrap: Update from slingshot. -2014-12-18 Gary V. Vaughan - slingshot: sync with upstream, for luaexec_LTLIBRARIES support. Close #5. * slingshot: Sync with upstream. @@ -409,6 +465,8 @@ configury: remove references to lua52compat.h. * local.mk (EXTRA_DIST): Remove ext/yaml/luacompat.h. +2014-12-16 Gary V. Vaughan + slingshot: sync with upstream, for release fixes. * slingshot: Sync with upstream. @@ -444,12 +502,10 @@ (luaL_register): Lua 5.2 and 5.3 compatibility definitions. * .travis.yml: Regenerate. -2014-12-16 Gary V. Vaughan - configury: adopt semantic versioning. * configure.ac (AC_INIT): Bump version to 6.0.0. -2014-09-26 Gary V. Vaughan +2014-09-25 Gary V. Vaughan maint: post-release administrivia. * configure.ac (AC_INIT): Bump release version to 6. @@ -457,8 +513,6 @@ * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. -2014-09-25 Gary V. Vaughan - Release version 5 * NEWS: Record release date. @@ -577,7 +631,7 @@ add waffle.io badge -2014-05-21 Gary V. Vaughan +2014-05-20 Gary V. Vaughan maint: fix a README typo. * README.md: Remove a spurious word. @@ -591,15 +645,13 @@ else `GIT=true ./bootstrap` doesn't work. * .travis.yml: Regenerate. -2014-01-05 Gary V. Vaughan +2014-01-04 Gary V. Vaughan slingshot: sync with upstream. Fix the annoying contest.sed file dropping bug. * slingshot: Sync with upstream. * bootstrap: Sync with slingshot. -2014-01-04 Gary V. Vaughan - maint: update copyright notices to include 2014. * .x-upate-copyright: New file. Exclude files not owned by this project from update-copyright rules. @@ -620,7 +672,7 @@ copying over a standard GPLv3 COPYING boilerplate. * .travis.yml: Regenerate. -2013-11-15 Gary V. Vaughan +2013-11-14 Gary V. Vaughan maint: prevent pointer type mismatch warnings. * ext/yaml/lyaml.h (lua_pushyamlstr): Cast away the impedence @@ -632,7 +684,7 @@ * ext/yaml/scanner.c (Pscanner): Likewise. * NEWS: Update. -2013-09-11 Gary V. Vaughan +2013-09-10 Gary V. Vaughan maint: post-release administrivia. * configure.ac (AC_INIT): Bump revision to 5. @@ -643,14 +695,12 @@ Release version 4 * NEWS: Record release date. -2013-08-30 Gary V. Vaughan +2013-08-29 Gary V. Vaughan docs: update README. * README.md: Remove documentation for removed lyaml.configure call, and add documentation for new yaml.emitter call. -2013-08-29 Gary V. Vaughan - specs: remove trailing blanks. * specs/ext_yaml_emitter_spec.yaml: Remove trailing blanks. @@ -734,6 +784,8 @@ * slingshot: Pick up recent improvements, particularly compatibility with upcoming lyaml 4 release. +2013-07-27 Gary V. Vaughan + scanner: bind YAML tokenizer. * specs/ext_lyaml_scanner_spec.yaml: New file. Specify behaviour of tokenizing scanner. @@ -745,8 +797,6 @@ * README.md: Add instructions for using lyaml.scanner(). * NEWS: Update. -2013-07-27 Gary V. Vaughan - parser: factor out function dispatch for simple events. * ext/lyaml/parser.c (parse_STREAM_END, parse_SEQUENCE_END) (parse_MAPPING_END): Delete. @@ -792,7 +842,7 @@ ...from here. Adjust all callers. -2013-07-26 Gary V. Vaughan +2013-07-25 Gary V. Vaughan docs: add missing link, and missing space. * README.md: Add missing [libtool][] destination and insert a @@ -802,8 +852,6 @@ * README.md: Rewrite to provide a tiny bit more insight into how to install and use lyaml. -2013-07-25 Gary V. Vaughan - specs: quote 5.2 illegal escapes carefully. * specs/parser_spec.yaml: Use [[]] quoting to prevent Lua 5.2 from trying to resolve \ as an escape sequence. @@ -831,7 +879,7 @@ * local.mk (EXTRA_DIST): Add parser.c. * NEWS: Update. -2013-07-15 Gary V. Vaughan +2013-07-14 Gary V. Vaughan slingshot: sync with upstream. Use upstream slingshot, which prevents us requesting installation @@ -893,6 +941,8 @@ and rockspec_conf. (smc_rockspec): git rockspec is always revision 1! +2013-04-26 Gary V. Vaughan + maint: support external_dependencies with mkrockspecs. * build-aux/mkrockspecs: Support ordering of external_dependencies. Add quote marks around various paths in case of whitespace after @@ -902,8 +952,6 @@ * rockspec.conf (external_dependencies): Required for a correct build. -2013-04-26 Gary V. Vaughan - Revert "maint: post-release administrivia." This reverts commit 9fcdd06a1f88d6db0ab344b0de4dda314ff8eb8c. @@ -957,6 +1005,8 @@ interpreter in the build matrix. (script): Pass LUA_INCDIR to make luarocks-config.lua rule. +2013-04-05 Gary V. Vaughan + maint: move Travis CI local luarocks build into install key. * .travis.yml (script): Move local luarocks build from here... (install): ...to here. @@ -1032,7 +1082,7 @@ maint: use travis CI server. * .travis.yml: New file. Travis CI directives. -2013-03-18 Gary V. Vaughan +2013-03-17 Gary V. Vaughan docs: insert missing link. * README.md (Lua): Add missing URL. @@ -1047,8 +1097,6 @@ * GNUmakefile, Makefile.am, bootstrap.conf, configure.ac: Relicense files authored by me under MIT. -2013-03-17 Gary V. Vaughan - maint: bump release number to 2. * configure.ac (AC_INIT): Bump release number to 2. diff --git a/GNUmakefile b/GNUmakefile index f477d0a..12eada8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ # Maintainer rules. # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # This program is free software; you can redistribute it and/or modify it diff --git a/Makefile.am b/Makefile.am index 4ade870..c1cb3ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # Non-recursive Make rules. # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # This program is free software; you can redistribute it and/or modify it diff --git a/Makefile.in b/Makefile.in index f308cbf..d1b75f8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ # Non-recursive Make rules. # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # This program is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ # Non-recursive Make rules. # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # Permission is hereby granted, free of charge, to any person obtaining @@ -58,7 +58,7 @@ # Lyaml Specl make rules. # -# Copyright (c) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # This program is free software; you can redistribute it and/or modify it @@ -80,7 +80,7 @@ # terms of the MIT license reproduced below. # ==================================================================== # -# Copyright (C) 2013-2015 Gary V. Vaughan # +# Copyright (C) 2013-2016 Gary V. Vaughan # # # # Permission is hereby granted, free of charge, to any person # # obtaining a copy of this software and associated documentation # @@ -111,7 +111,7 @@ # terms of the MIT license reproduced below. # ==================================================================== # -# Copyright (C) 2013-2015 Reuben Thomas and Gary V. Vaughan # +# Copyright (C) 2013-2016 Reuben Thomas and Gary V. Vaughan # # # # Permission is hereby granted, free of charge, to any person # # obtaining a copy of this software and associated documentation # @@ -265,7 +265,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(luaexecdir)" \ "$(DESTDIR)$(lualyamldir)" "$(DESTDIR)$(modulesdir)" \ "$(DESTDIR)$(docdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(luaexec_LTLIBRARIES) -ext_yaml_yaml_la_LIBADD = +am__DEPENDENCIES_1 = +ext_yaml_yaml_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = am_ext_yaml_yaml_la_OBJECTS = ext/yaml/ext_yaml_yaml_la-yaml.lo \ @@ -417,6 +418,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBYAML = @LIBYAML@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -576,7 +578,8 @@ ext_yaml_yaml_la_SOURCES = \ $(NOTHING_ELSE) ext_yaml_yaml_la_LDFLAGS = -module -avoid-version -ext_yaml_yaml_la_CPPFLAGS = $(LUA_INCLUDE) $(YAML_INCLUDE) +ext_yaml_yaml_la_CPPFLAGS = $(LUA_INCLUDE) +ext_yaml_yaml_la_LIBADD = $(LIBYAML) lualyamldir = $(luadir)/lyaml dist_lualyaml_DATA = \ lib/lyaml/explicit.lua \ diff --git a/NEWS b/NEWS index 5018442..0cf9c8f 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,21 @@ # lyaml NEWS - User visible changes +## Noteworthy changes in release 6.1 (2016-10-08) [stable] + +### Bug fixes + + - `lyaml.load` now correctly reads implicit null scalars in a YAML + document as an `lyaml.null` reference, identical to the "~" + shorthand syntax, according to [the specification][nullspec]. + + ```yaml + empty: + canonical: ~ + english: null + ~: null key + ``` + + ## Noteworthy changes in release 6.0 (2015-07-27) [stable] ### New Features diff --git a/bootstrap b/bootstrap index 0b70e37..4ad90d5 100755 --- a/bootstrap +++ b/bootstrap @@ -1,36 +1,30 @@ #! /bin/sh ## DO NOT EDIT - This file generated from build-aux/bootstrap.in -## by inline-source v2014-01-03.01 +## by inline-source v2016-02-21.11 # Bootstrap an Autotooled package from checked-out sources. # Written by Gary V. Vaughan, 2010 +# Inspired by a script written by Paul Eggert. -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2016 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Originally written by Paul Eggert. The canonical version of this -# script is maintained as build-aux/bootstrap in gnulib, however, to -# be useful to your project, you should place a copy of it under -# version control in the top-level directory of your project. The -# intent is that all customization can be done with a bootstrap.conf -# file also maintained in your version control; gnulib comes with a -# template build-aux/bootstrap.conf to get you started. +# You should place a copy of this script under version control in the +# top-level directory of your project. The intent is that all +# customization can be done with a `bootstrap.conf` file also maintained +# in your version control. -# Please report bugs or propose patches to bug-gnulib@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -143,7 +137,7 @@ package_bugreport= doc_base= gnulib_mk= gnulib_name= -local_gl_dir= +local_gl_path= source_base= tests_base= @@ -249,34 +243,25 @@ slingshot_url=$slingshot_url # Source required external libraries: # Set a version string for this script. -scriptversion=2014-01-03.01; # UTC +scriptversion=2016-02-28.16; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2016 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -325,9 +310,6 @@ do fi" done -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - # Make sure IFS has a sensible default sp=' ' nl=' @@ -344,6 +326,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -377,7 +379,7 @@ func_path_progs () _G_path_prog_max=0 _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. @@ -976,16 +978,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1487,85 +1489,199 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + case $func_quote_portable_result in + *[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1611,8 +1727,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1637,8 +1753,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1765,30 +1881,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2016 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2016-03-06.01; # UTC ## ------ ## @@ -1811,7 +1923,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1823,7 +1935,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1872,8 +1984,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1906,7 +2018,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1915,10 +2028,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1928,22 +2059,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1953,10 +2081,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1966,9 +2102,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1977,25 +2112,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -2006,17 +2152,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -2026,17 +2181,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -2045,9 +2210,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -2058,9 +2222,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -2072,25 +2234,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -2100,7 +2269,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -2153,15 +2325,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -2178,12 +2359,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -2208,9 +2387,6 @@ Slingshot Options: check a non-default tree for prerequisite rocks --skip-rock-checks ignore Lua rocks in bootstrap.conf:buildreq' - - func_quote_for_eval ${1+"$@"} - slingshot_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep slingshot_options_prep @@ -2223,6 +2399,8 @@ slingshot_parse_options () { $debug_cmd + args_changed=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do @@ -2233,10 +2411,12 @@ slingshot_parse_options () test $# = 0 && func_missing_arg $_G_opt && break opt_luarocks_tree=$1 shift + args_changed=: ;; --skip-rock-checks) opt_skip_rock_checks=: + args_changed=: ;; # Separate optargs to long options (plugins may need this): @@ -2250,9 +2430,11 @@ slingshot_parse_options () esac done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - slingshot_parse_options_result=$func_quote_for_eval_result + # save modified positional parameters for caller if we changed them + if $args_changed; then + func_quote eval ${1+"$@"} + slingshot_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options slingshot_parse_options @@ -2322,8 +2504,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -2338,8 +2520,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -2417,31 +2600,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blank + /./ { + n + b fwd2blank } - /^# Written by / { - s|^# || - p + p; n + + :holdwarranty + s|^# || + s|^# *$|| + /^Copyright /! { + /./H + n + b holdwarranty } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2459,31 +2655,27 @@ func_version () # Extract macro arguments from autotools input with GNU M4. # Written by Gary V. Vaughan, 2010 # -# Copyright (C) 2010-2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2016 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# # Make sure we've evaluated scripts we depend on. test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh test extract-trace = "$progname" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/options-parser # Set a version string. -scriptversion=2014-12-03.16; # UTC - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +scriptversion=2016-02-22.14; # UTC # slingshot_copy FILENAME SRCDIR DESTDIR @@ -2698,7 +2890,7 @@ func_find_tool () for _G_prog do _G_find_tool_save_IFS=$IFS - IFS=: + IFS=${PATH_SEPARATOR-:} for _G_dir in $PATH; do IFS=$_G_find_tool_save_IFS _G_progpath=$_G_dir/$_G_prog @@ -2861,29 +3053,41 @@ func_extract_trace () # arguments to Autocof functions, but without following # 'm4_s?include' files. _G_mini=' - # Initialisation. + dnl Initialisation. m4_changequote([,]) m4_define([m4_copy], [m4_define([$2], m4_defn([$1]))]) m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])]) - # Disable these macros. - m4_undefine([m4_dnl]) - m4_undefine([m4_include]) - m4_undefine([m4_m4exit]) - m4_undefine([m4_m4wrap]) - m4_undefine([m4_maketemp]) + dnl Replace macros which may abort m4 with a no-op variant. + m4_pushdef([m4_assert]) + m4_pushdef([m4_exit]) + m4_pushdef([m4_fatal]) + m4_pushdef([m4_m4exit]) + + dnl Replace macros that might break stderr of m4. + m4_pushdef([m4_errprint]) + m4_pushdef([m4_errprintn]) + m4_pushdef([m4_include]) + m4_pushdef([m4_warn]) + + dnl Avoid side-effects of tracing by extract-trace. + m4_pushdef([m4_maketemp]) + m4_pushdef([m4_mkstemp]) + + dnl TODO: reasons for this + m4_pushdef([m4_dnl]) + m4_pushdef([m4_m4wrap]) - # Copy and rename macros not handled by "m4 --prefix". + dnl Copy and rename macros not handled by "m4 --prefix". m4_define([dnl], [m4_builtin([dnl])]) m4_copy([m4_define], [m4_defun]) m4_rename([m4_ifelse], [m4_if]) - m4_ifdef([m4_mkstemp], [m4_undefine([m4_mkstemp])]) m4_rename([m4_patsubst], [m4_bpatsubst]) m4_rename([m4_regexp], [m4_bregexp]) - # "m4sugar.mini" - useful m4-time macros for dynamic arguments. - # If we discover packages that need more m4 macros defined in - # order to bootstrap correctly, add them here: + dnl "m4sugar.mini" - useful m4-time macros for dynamic arguments. + dnl If we discover packages that need more m4 macros defined in + dnl order to bootstrap correctly, add them here: m4_define([m4_bmatch], [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2], [m4_if(m4_bregexp([$1], [$2]), -1, @@ -2894,11 +3098,11 @@ func_extract_trace () m4_define([m4_require], [$1]) m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))]) - # "autoconf.mini" - things from autoconf macros we care about. + dnl "autoconf.mini" - things from autoconf macros we care about. m4_copy([m4_defun], [AC_DEFUN]) - # Dummy definitions for the macros we want to trace. - # AM_INIT_AUTOMAKE at least produces no trace without this. + dnl Dummy definitions for the macros we want to trace. + dnl AM_INIT_AUTOMAKE at least produces no trace without this. ' _G_save=$IFS @@ -3010,7 +3214,7 @@ test extract-trace = "$progname" && func_main "$@" # End: # Set a version string for *this* script. -scriptversion=2014-11-04.13; # UTC +scriptversion=2016-02-28.16; # UTC ## ------------------- ## @@ -3038,8 +3242,8 @@ func_bootstrap () # Save the current positional parameters to prevent them being # corrupted by calls to 'set' in 'func_init'. - func_quote_for_eval ${1+"$@"} - _G_saved_positional_parameters=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + _G_saved_positional_parameters=$func_quote_result # Initialisation. func_init @@ -3199,6 +3403,8 @@ func_gnulib_tool () $require_libtoolize test true = "$gnulib_tool" || { + $require_gnulib_git_submodules + # bootstrap.conf written for gnulib bootstrap expects # gnulib_tool_option_extras to which --no-changelog is appended, # but libtool bootstrap expects you to append to gnulib_tool_options @@ -3597,7 +3803,7 @@ func_libtoolize () # ----------------------------------- # Copy SRC, a path relative to the gnulib sub-tree, to DEST, a path # relative to the top-level source directory using gnulib-tool so that -# any patches or replacements in $local_gl_dir are applied. +# any patches or replacements in $local_gl_path are applied. func_gnulib_tool_copy_file () { $debug_cmd @@ -3922,6 +4128,26 @@ func_update_dotversion () # most, once. +# require_gnulib_git_submodules +# ----------------------------- +# Initialize all git modules from $gnulib_git_submodules before we +# run 'gnulib-tool'. +require_gnulib_git_submodules=func_require_gnulib_git_submodules +func_require_gnulib_git_submodules () +{ + test -n "$gnulib_git_submodules" && { + for _G_submodule in $gnulib_git_submodules + do + func_show_eval "git submodule init -- $_G_submodule" \ + && func_show_eval "git submodule update -- $_G_submodule" \ + || func_fatal_error "Unable to init git module '$_G_submodule'." + done + } + + require_gnulib_git_submodules=: +} + + # require_checkout_only_file # -------------------------- # Bail out if this package only bootstraps properly from a repository @@ -4225,13 +4451,13 @@ func_require_buildreq_automake () # require_buildreq_patch # ---------------------- # Automatically add a patch build-requirement if there are diff files -# in $local_gl_dir. +# in $local_gl_path. require_buildreq_patch=func_require_buildreq_patch func_require_buildreq_patch () { $debug_cmd - $require_local_gl_dir + $require_local_gl_path # This ensures PATCH is set appropriately by the time # func_check_versions enforces $buildreq. @@ -4239,14 +4465,19 @@ func_require_buildreq_patch () # If patch is not already listed in $buildreq... printf '%s\n' "$buildreq" |func_grep_q '^[ ]*patch' || { - # The ugly find invocation is necessary to exit with non-zero - # status for old find binaries that don't support -exec fully. - if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : - else - func_append buildreq 'patch - http://www.gnu.org/s/patch -' - fi + eval "set dummy $local_gl_path_quoted" ; shift + + for _G_dir + do + # The ugly find invocation is necessary to exit with non-zero + # status for old find binaries that don't support -exec fully. + if test ! -d "$_G_dir" \ + || find "$_G_dir" -name "*.diff" -exec false {} \; ; then : + else + func_append buildreq "patch - http://www.gnu.org/s/patch$nl" + break + fi + done } require_buildreq_patch=: @@ -4680,9 +4911,14 @@ func_require_gnulib_tool_base_options () $require_gnulib_name test -n "$gnulib_name" \ && func_append_uniq gnulib_tool_base_options " --lib=$gnulib_name" - $require_local_gl_dir - test -n "$local_gl_dir" \ - && func_append_uniq gnulib_tool_base_options " --local-dir=$local_gl_dir" + $require_local_gl_path + test -n "$local_gl_path" && { + eval "set dummy $local_gl_path_quoted" ; shift + for _G_dir + do + func_append_uniq gnulib_tool_base_options " --local-dir=$_G_dir" + done + } $require_source_base test -n "$source_base" \ && func_append_uniq gnulib_tool_base_options " --source-base=$source_base" @@ -4729,25 +4965,49 @@ Please install GNU Libtool, or 'export LIBTOOLIZE=/path/to/libtoolize'." } -# require_local_gl_dir -# -------------------- -# Ensure local_gl_dir has a sensible value, extracted from 'gnulib-cache.m4' -# if possible, otherwise letting 'gnulib-tool' pick a default. -require_local_gl_dir=func_require_local_gl_dir -func_require_local_gl_dir () +# require_local_gl_path +# --------------------- +# Ensure local_gl_path has a sensible value, extracted from 'gnulib-cache.m4' if +# possible, otherwise letting 'gnulib-tool' pick a default. +require_local_gl_path=func_require_local_gl_path +func_require_local_gl_path () { $debug_cmd $require_gnulib_cache - test -f "$gnulib_cache" && test -z "$local_gl_dir" && { + # Compat with older bootstrap versions. + test -n "$local_gl_dir" && { + func_warning settings "\ +Please use 'local_gl_path' instead of 'local_gl_dir' in your +'bootstrap.conf' file." + local_gl_path=$local_gl_dir + local_gl_dir= + } + + test -f "$gnulib_cache" && test -z "$local_gl_path" && { func_extract_trace_first "gl_LOCAL_DIR" "$gnulib_cache" - local_gl_dir=$func_extract_trace_first_result + local_gl_path=$func_extract_trace_first_result + test -n "$local_gl_path" && func_verbose "local_gl_path='$local_gl_path'" + } - test -n "$local_gl_dir" && func_verbose "local_gl_dir='$local_gl_dir'" + test -z "$local_gl_path_quoted" && test -n "$local_gl_path" && { + save_IFS=$IFS + set dummy + # Don't use PATH_SEPARATOR here, gnulib must be fixed to store only ':' as + # path separator into gnulib-cache.m4 (consistency reasons among systems). + IFS=: + for _G_dir in $local_gl_path + do + set "$@" "$_G_dir" + done + shift + IFS=$save_IFS + func_quote eval "$@" + local_gl_path_quoted=$func_quote_result } - require_local_gl_dir=: + require_local_gl_path=: } @@ -5046,21 +5306,6 @@ else fi -# func_unset VAR -# -------------- -# Portably unset VAR. -# In some shells, an 'unset VAR' statement leaves a non-zero return -# status if VAR is already unset, which might be problematic if the -# statement is used at the end of a function (thus poisoning its return -# value) or when 'set -e' is active (causing even a spurious abort of -# the script in this case). -func_unset () -{ - { eval $1=; unset $1; } -} -unset=func_unset - - # func_cmp_s FILE1 FILE2 # ---------------------- # Return non-zero exit status unless FILE1 and FILE2 are identical, without @@ -5301,8 +5546,8 @@ func_show_eval () _G_fail_exp=${2-':'} ${opt_silent-'false'} || { - func_quote_for_eval $_G_cmd - eval func_truncate_cmd $func_quote_for_eval_result + func_quote eval $_G_cmd + eval func_truncate_cmd $func_quote_result func_echo "running: $tc_bold$func_truncate_cmd_result$tc_reset" } @@ -5689,8 +5934,8 @@ bootstrap_options_prep () opt_skip_po=false # Pass back the list of options we consumed. - func_quote_for_eval ${1+"$@"} - bootstrap_options_prep_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + bootstrap_options_prep_result=$func_quote_result } func_add_hook func_options_prep bootstrap_options_prep @@ -5740,8 +5985,8 @@ bootstrap_parse_options () done # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - bootstrap_parse_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + bootstrap_parse_options_result=$func_quote_result } func_add_hook func_parse_options bootstrap_parse_options @@ -5759,8 +6004,8 @@ bootstrap_validate_options () && func_fatal_help "too many arguments" # Pass back the (empty) list of unconsumed options. - func_quote_for_eval ${1+"$@"} - bootstrap_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + bootstrap_validate_options_result=$func_quote_result } func_add_hook func_validate_options bootstrap_validate_options diff --git a/bootstrap.conf b/bootstrap.conf index 07bdc31..b590e15 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -1,7 +1,7 @@ # bootstrap.conf (lyaml) version 2014-01-04 # Written by Gary V. Vaughan, 2013 # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/build-aux/mkrockspecs b/build-aux/mkrockspecs index 622d328..a64a515 100755 --- a/build-aux/mkrockspecs +++ b/build-aux/mkrockspecs @@ -6,7 +6,7 @@ SH=--[[ # -*- mode: lua; -*- ## terms of the MIT license reproduced below. ## ==================================================================== -## Copyright (C) 2013-2015 Gary V. Vaughan +## Copyright (C) 2013-2016 Gary V. Vaughan ## ## Permission is hereby granted, free of charge, to any person ## obtaining a copy of this software and associated documentation @@ -158,7 +158,7 @@ Report bugs to http://github.com/gvvaughan/slingshot/issues.]]) end prog["--version"] = function () - print [[mkrockspecs (slingshot) 8.0.0 + print [[mkrockspecs (slingshot) 8.0.1 Written by Gary V. Vaughan , 2013 Copyright (C) 2013, Gary V. Vaughan diff --git a/build-aux/release.mk b/build-aux/release.mk index 13dce9a..a6801e2 100644 --- a/build-aux/release.mk +++ b/build-aux/release.mk @@ -1,7 +1,7 @@ # Slingshot release rules for GNU Make. # ====================================================================== -# Copyright (C) 2001-2015 Free Software Foundation, Inc. +# Copyright (C) 2001-2016 Free Software Foundation, Inc. # Originally by Jim Meyering, Simon Josefsson, Eric Blake, # Akim Demaille, Gary V. Vaughan, and others. # This version by Gary V. Vaughan, 2013. @@ -365,7 +365,7 @@ check-in-release-branch: $(AM_V_at)remove_re=$(grep-clean-files); \ $(GIT) rm -f `$(GIT) ls-files |$(EGREP) -v "$$remove_re"` $(AM_V_at)ln -s . '$(my_distdir)' - $(AM_V_at)$(TAR) zxf '$(release-tarball)' + $(AM_V_at)$(TAR) zxhf '$(release-tarball)' $(AM_V_at)rm -f '$(my_distdir)' '$(release-tarball)' $(AM_V_at)$(GIT) add . $(AM_V_at)$(GIT) commit -s -a -m 'Release v$(VERSION).' diff --git a/build-aux/rockspecs.mk b/build-aux/rockspecs.mk index e64cab1..ebd1dbf 100644 --- a/build-aux/rockspecs.mk +++ b/build-aux/rockspecs.mk @@ -4,7 +4,7 @@ # terms of the MIT license reproduced below. # ==================================================================== # -# Copyright (C) 2013-2015 Reuben Thomas and Gary V. Vaughan # +# Copyright (C) 2013-2016 Reuben Thomas and Gary V. Vaughan # # # # Permission is hereby granted, free of charge, to any person # # obtaining a copy of this software and associated documentation # diff --git a/build-aux/specl.mk b/build-aux/specl.mk index 530d961..bba8836 100644 --- a/build-aux/specl.mk +++ b/build-aux/specl.mk @@ -4,7 +4,7 @@ # terms of the MIT license reproduced below. # ==================================================================== # -# Copyright (C) 2013-2015 Gary V. Vaughan # +# Copyright (C) 2013-2016 Gary V. Vaughan # # # # Permission is hereby granted, free of charge, to any person # # obtaining a copy of this software and associated documentation # diff --git a/configure b/configure index df8ea33..76f8d62 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lyaml 6.0. +# Generated by GNU Autoconf 2.69 for lyaml 6.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='lyaml' PACKAGE_TARNAME='lyaml' -PACKAGE_VERSION='6.0' -PACKAGE_STRING='lyaml 6.0' +PACKAGE_VERSION='6.1' +PACKAGE_STRING='lyaml 6.1' PACKAGE_BUGREPORT='http://github.com/gvvaughan/lyaml/issues' PACKAGE_URL='' @@ -635,9 +635,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -HAVE_LDOC_FALSE -HAVE_LDOC_TRUE -LDOC +LIBYAML LUA_INCLUDE pkgluaexecdir luaexecdir @@ -649,6 +647,9 @@ LUA_PLATFORM LUA_SHORT_VERSION LUA_VERSION LUA +HAVE_LDOC_FALSE +HAVE_LDOC_TRUE +LDOC SPECL LIBTOOL_DEPS shrext @@ -1332,7 +1333,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lyaml 6.0 to adapt to many kinds of systems. +\`configure' configures lyaml 6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1402,7 +1403,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lyaml 6.0:";; + short | recursive ) echo "Configuration of lyaml 6.1:";; esac cat <<\_ACEOF @@ -1514,7 +1515,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lyaml configure 6.0 +lyaml configure 6.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1883,7 +1884,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lyaml $as_me 6.0, which was +It was created by lyaml $as_me 6.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2263,7 +2264,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. $as_echo "## --------------------- ## -## Configuring lyaml 6.0 ## +## Configuring lyaml 6.1 ## ## --------------------- ##" echo @@ -2753,7 +2754,7 @@ fi # Define the identity of the package. PACKAGE='lyaml' - VERSION='6.0' + VERSION='6.1' cat >>confdefs.h <<_ACEOF @@ -12901,195 +12902,6 @@ else fi - -## Check for header files -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -for ac_header in yaml.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "yaml.h" "ac_cv_header_yaml_h" "$ac_includes_default" -if test "x$ac_cv_header_yaml_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_YAML_H 1 -_ACEOF - -fi - -done - - -## Search libs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_document_initialize" >&5 -$as_echo_n "checking for library containing yaml_document_initialize... " >&6; } -if ${ac_cv_search_yaml_document_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char yaml_document_initialize (); -int -main () -{ -return yaml_document_initialize (); - ; - return 0; -} -_ACEOF -for ac_lib in '' yaml; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_yaml_document_initialize=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_yaml_document_initialize+:} false; then : - break -fi -done -if ${ac_cv_search_yaml_document_initialize+:} false; then : - -else - ac_cv_search_yaml_document_initialize=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_document_initialize" >&5 -$as_echo "$ac_cv_search_yaml_document_initialize" >&6; } -ac_res=$ac_cv_search_yaml_document_initialize -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - - as_fn_error $? "Required library 'yaml' could not be found" "$LINENO" 5 -fi - - -## Lua # Extract the first word of "specl", so it can be a program name with args. set dummy specl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -13131,6 +12943,55 @@ $as_echo "no" >&6; } fi +# Extract the first word of "ldoc", so it can be a program name with args. +set dummy ldoc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_LDOC="$LDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_LDOC" && ac_cv_path_LDOC="false" + ;; +esac +fi +LDOC=$ac_cv_path_LDOC +if test -n "$LDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDOC" >&5 +$as_echo "$LDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test false != "$LDOC"; then + HAVE_LDOC_TRUE= + HAVE_LDOC_FALSE='#' +else + HAVE_LDOC_TRUE='#' + HAVE_LDOC_FALSE= +fi + @@ -13455,6 +13316,120 @@ $as_echo "$ax_cv_lua_luaexecdir" >&6; } +fi + + +## Check for header files +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + fi @@ -13622,57 +13597,83 @@ else as_fn_error $? "cannot find Lua includes" "$LINENO" 5 fi +for ac_header in yaml.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "yaml.h" "ac_cv_header_yaml_h" "$ac_includes_default" +if test "x$ac_cv_header_yaml_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_YAML_H 1 +_ACEOF -## LDoc -# Extract the first word of "ldoc", so it can be a program name with args. -set dummy ldoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDOC+:} false; then : +fi + +done + + +## Search libs +save_LIBS=$LIBS LIBS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_document_initialize" >&5 +$as_echo_n "checking for library containing yaml_document_initialize... " >&6; } +if ${ac_cv_search_yaml_document_initialize+:} false; then : $as_echo_n "(cached) " >&6 else - case $LDOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDOC="$LDOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char yaml_document_initialize (); +int +main () +{ +return yaml_document_initialize (); + ; + return 0; +} +_ACEOF +for ac_lib in '' yaml; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_yaml_document_initialize=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_yaml_document_initialize+:} false; then : + break +fi done - done -IFS=$as_save_IFS +if ${ac_cv_search_yaml_document_initialize+:} false; then : - test -z "$ac_cv_path_LDOC" && ac_cv_path_LDOC="false" - ;; -esac -fi -LDOC=$ac_cv_path_LDOC -if test -n "$LDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDOC" >&5 -$as_echo "$LDOC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_search_yaml_document_initialize=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_document_initialize" >&5 +$as_echo "$ac_cv_search_yaml_document_initialize" >&6; } +ac_res=$ac_cv_search_yaml_document_initialize +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - if test false != "$LDOC"; then - HAVE_LDOC_TRUE= - HAVE_LDOC_FALSE='#' else - HAVE_LDOC_TRUE='#' - HAVE_LDOC_FALSE= + + as_fn_error $? "Required library 'yaml' could not be found" "$LINENO" 5 fi +LIBYAML=$LIBS + +LIBS=$save_LIBS ## Generate output files ac_config_headers="$ac_config_headers config.h" @@ -14217,7 +14218,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lyaml $as_me 6.0, which was +This file was extended by lyaml $as_me 6.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14283,7 +14284,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lyaml config.status 6.0 +lyaml config.status 6.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ca20229..5e0f53f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ ## configure.ac ## Written by Gary V. Vaughan, 2013 ## -## Copyright (C) 2013-2015 Gary V. Vaughan +## Copyright (C) 2013-2016 Gary V. Vaughan ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this software and associated documentation files (the @@ -26,7 +26,7 @@ AC_PREREQ([2.68]) ## Initialise autoconf and automake -AC_INIT([lyaml], [6.0], [http://github.com/gvvaughan/lyaml/issues]) +AC_INIT([lyaml], [6.1], [http://github.com/gvvaughan/lyaml/issues]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -50,23 +50,22 @@ AC_SUBST(LIBTOOL_DEPS) ## Check for programs AC_PROG_CC +AC_PATH_PROG([SPECL], [specl], [:]) +AC_PATH_PROG([LDOC], [ldoc], [false]) +AM_CONDITIONAL([HAVE_LDOC], [test false != "$LDOC"]) +AX_PROG_LUA(5.1, 5.4) ## Check for header files AC_HEADER_STDC +AX_LUA_HEADERS AC_CHECK_HEADERS([yaml.h]) ## Search libs +save_LIBS=$LIBS LIBS= AC_SEARCH_LIBS([yaml_document_initialize], [yaml], [], [ AC_MSG_ERROR([Required library 'yaml' could not be found])]) - -## Lua -AC_PATH_PROG([SPECL], [specl], [:]) -AX_PROG_LUA(5.1, 5.4) -AX_LUA_HEADERS - -## LDoc -AC_PATH_PROG([LDOC], [ldoc], [false]) -AM_CONDITIONAL([HAVE_LDOC], [test false != "$LDOC"]) +AC_SUBST([LIBYAML], [$LIBS]) +LIBS=$save_LIBS ## Generate output files AC_CONFIG_HEADERS([config.h]) diff --git a/doc/index.html b/doc/index.html index 6a6e0c2..d90bba7 100644 --- a/doc/index.html +++ b/doc/index.html @@ -3,7 +3,7 @@ - lyaml 6.0 Reference + lyaml 6.1 Reference @@ -24,13 +24,13 @@
-generated by LDoc 1.4.3 -Last updated 2015-07-27 01:35:37 +generated by LDoc 1.4.5 +Last updated 2016-10-08 11:19:36
diff --git a/doc/ldoc.css b/doc/ldoc.css index ce77ac8..52c4ad2 100644 --- a/doc/ldoc.css +++ b/doc/ldoc.css @@ -28,7 +28,6 @@ del,ins { text-decoration: none; } li { - list-style: disc; margin-left: 20px; } caption,th { @@ -88,7 +87,7 @@ em { font-style: italic;} h1 { font-size: 1.5em; - margin: 0 0 20px 0; + margin: 20px 0 20px 0; } h2, h3, h4 { margin: 15px 0 10px 0; } h2 { font-size: 1.25em; } diff --git a/doc/modules/lyaml.explicit.html b/doc/modules/lyaml.explicit.html index 36ca3ac..1d4c8e7 100644 --- a/doc/modules/lyaml.explicit.html +++ b/doc/modules/lyaml.explicit.html @@ -3,7 +3,7 @@ - lyaml 6.0 Reference + lyaml 6.1 Reference @@ -24,7 +24,7 @@
-generated by LDoc 1.4.3 -Last updated 2015-07-27 01:35:37 +generated by LDoc 1.4.5 +Last updated 2016-10-08 11:19:36
diff --git a/doc/modules/lyaml.functional.html b/doc/modules/lyaml.functional.html index 58772aa..6079658 100644 --- a/doc/modules/lyaml.functional.html +++ b/doc/modules/lyaml.functional.html @@ -3,7 +3,7 @@ - lyaml 6.0 Reference + lyaml 6.1 Reference @@ -24,7 +24,7 @@
-generated by LDoc 1.4.3 -Last updated 2015-07-27 01:35:37 +generated by LDoc 1.4.5 +Last updated 2016-10-08 11:19:36
diff --git a/doc/modules/lyaml.html b/doc/modules/lyaml.html index 1ada3e1..14c4d2b 100644 --- a/doc/modules/lyaml.html +++ b/doc/modules/lyaml.html @@ -3,7 +3,7 @@ - lyaml 6.0 Reference + lyaml 6.1 Reference @@ -24,7 +24,7 @@
-generated by LDoc 1.4.3 -Last updated 2015-07-27 01:35:37 +generated by LDoc 1.4.5 +Last updated 2016-10-08 11:19:36
diff --git a/doc/modules/lyaml.implicit.html b/doc/modules/lyaml.implicit.html index 22eb2dc..213c239 100644 --- a/doc/modules/lyaml.implicit.html +++ b/doc/modules/lyaml.implicit.html @@ -3,7 +3,7 @@ - lyaml 6.0 Reference + lyaml 6.1 Reference @@ -24,7 +24,7 @@
-generated by LDoc 1.4.3 -Last updated 2015-07-27 01:35:37 +generated by LDoc 1.4.5 +Last updated 2016-10-08 11:19:36
diff --git a/ext/yaml/emitter.c b/ext/yaml/emitter.c index 80360a8..b68710e 100644 --- a/ext/yaml/emitter.c +++ b/ext/yaml/emitter.c @@ -2,7 +2,7 @@ * emitter.c, LibYAML emitter binding for Lua * Written by Gary V. Vaughan, 2013 * - * Copyright (c) 2013-2015 Gary V. Vaughan + * Copyright (C) 2013-2016 Gary V. Vaughan * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ext/yaml/lyaml.h b/ext/yaml/lyaml.h index 670057a..e9e8edf 100644 --- a/ext/yaml/lyaml.h +++ b/ext/yaml/lyaml.h @@ -2,7 +2,7 @@ * lyaml.h, libyaml parser binding for Lua * Written by Gary V. Vaughan, 2013 * - * Copyright (c) 2013-2015 Gary V. Vaughan + * Copyright (C) 2013-2016 Gary V. Vaughan * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ext/yaml/parser.c b/ext/yaml/parser.c index a9e628d..8799678 100644 --- a/ext/yaml/parser.c +++ b/ext/yaml/parser.c @@ -2,7 +2,7 @@ * parser.c, libyaml parser binding for Lua * Written by Gary V. Vaughan, 2013 * - * Copyright (c) 2013-2015 Gary V. Vaughan + * Copyright (C) 2013-2016 Gary V. Vaughan * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ext/yaml/scanner.c b/ext/yaml/scanner.c index b598a2f..6fafcec 100644 --- a/ext/yaml/scanner.c +++ b/ext/yaml/scanner.c @@ -2,7 +2,7 @@ * scanner.c, libyaml scanner binding for Lua * Written by Gary V. Vaughan, 2013 * - * Copyright (c) 2013-2015 Gary V. Vaughan + * Copyright (C) 2013-2016 Gary V. Vaughan * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ext/yaml/yaml.c b/ext/yaml/yaml.c index 8e80e90..6b1a680 100644 --- a/ext/yaml/yaml.c +++ b/ext/yaml/yaml.c @@ -2,7 +2,7 @@ * yaml.c, LibYAML binding for Lua * Written by Andrew Danforth, 2009 * - * Copyright (c) 2009, 2014-2015 Andrew Danforth + * Copyright (C) 2009, 2014-2016 Andrew Danforth * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/lib/lyaml.lua b/lib/lyaml.lua index b16f0c1..1f582cb 100644 --- a/lib/lyaml.lua +++ b/lib/lyaml.lua @@ -1,7 +1,7 @@ -- Transform between YAML 1.1 streams and Lua table representations. -- Written by Gary V. Vaughan, 2013 -- --- Copyright (c) 2013-2015 Gary V. Vaughan +-- Copyright (C) 2013-2016 Gary V. Vaughan -- -- Permission is hereby granted, free of charge, to any person obtaining -- a copy of this software and associated documentation files (the diff --git a/lib/lyaml/explicit.lua b/lib/lyaml/explicit.lua index a0fbb6f..d5676c5 100644 --- a/lib/lyaml/explicit.lua +++ b/lib/lyaml/explicit.lua @@ -1,7 +1,7 @@ -- LYAML parse explicit token values. -- Written by Gary V. Vaughan, 2015 -- --- Copyright (c) 2015 Gary V. Vaughan +-- Copyright (C) 2015-2016 Gary V. Vaughan -- -- Permission is hereby granted, free of charge, to any person obtaining -- a copy of this software and associated documentation files (the diff --git a/lib/lyaml/functional.lua b/lib/lyaml/functional.lua index ef8af18..d1bd3da 100644 --- a/lib/lyaml/functional.lua +++ b/lib/lyaml/functional.lua @@ -1,7 +1,7 @@ -- Minimal functional programming utilities. -- Written by Gary V. Vaughan, 2015 -- --- Copyright (c) 2015 Gary V. Vaughan +-- Copyright (C) 2015-2016 Gary V. Vaughan -- -- Permission is hereby granted, free of charge, to any person obtaining -- a copy of this software and associated documentation files (the diff --git a/lib/lyaml/implicit.lua b/lib/lyaml/implicit.lua index a43b0d8..3f0e19a 100644 --- a/lib/lyaml/implicit.lua +++ b/lib/lyaml/implicit.lua @@ -1,7 +1,7 @@ -- LYAML parse implicit type tokens. -- Written by Gary V. Vaughan, 2015 -- --- Copyright (c) 2015 Gary V. Vaughan +-- Copyright (C) 2015-2016 Gary V. Vaughan -- -- Permission is hereby granted, free of charge, to any person obtaining -- a copy of this software and associated documentation files (the @@ -28,6 +28,10 @@ local NULL = require "lyaml.functional".NULL +local is_null = { + [""] = true, ["~"] = true, null = true, Null = true, NULL = true, +} + --- Parse a null token to a null value. -- @param value token @@ -35,7 +39,7 @@ local NULL = require "lyaml.functional".NULL -- @return[2] nil otherwise, nil -- @usage maybe_null = implicit.null (token) local function null (value) - if value == "~" or value == "" then + if is_null[value] then return NULL end end diff --git a/local.mk b/local.mk index 69fe778..8bc1786 100644 --- a/local.mk +++ b/local.mk @@ -1,6 +1,6 @@ # Non-recursive Make rules. # -# Copyright (C) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # Permission is hereby granted, free of charge, to any person obtaining @@ -74,7 +74,8 @@ ext_yaml_yaml_la_SOURCES = \ $(NOTHING_ELSE) ext_yaml_yaml_la_LDFLAGS = -module -avoid-version -ext_yaml_yaml_la_CPPFLAGS = $(LUA_INCLUDE) $(YAML_INCLUDE) +ext_yaml_yaml_la_CPPFLAGS = $(LUA_INCLUDE) +ext_yaml_yaml_la_LIBADD = $(LIBYAML) EXTRA_DIST += \ ext/yaml/lyaml.h \ diff --git a/lyaml-6.0-1.rockspec b/lyaml-6.1-1.rockspec similarity index 86% rename from lyaml-6.0-1.rockspec rename to lyaml-6.1-1.rockspec index bc09d5c..9596d5c 100644 --- a/lyaml-6.0-1.rockspec +++ b/lyaml-6.1-1.rockspec @@ -1,5 +1,5 @@ package = "lyaml" -version = "6.0-1" +version = "6.1-1" description = { detailed = "Read and write YAML format files with Lua.", homepage = "http://github.com/gvvaughan/lyaml", @@ -7,8 +7,8 @@ description = { summary = "libYAML binding for Lua", } source = { - dir = "lyaml-release-v6.0", - url = "http://github.com/gvvaughan/lyaml/archive/release-v6.0.zip", + dir = "lyaml-release-v6.1", + url = "http://github.com/gvvaughan/lyaml/archive/release-v6.1.zip", } dependencies = { "lua >= 5.1, < 5.4", diff --git a/specs/lib_lyaml_spec.yaml b/specs/lib_lyaml_spec.yaml index 9015193..e474493 100644 --- a/specs/lib_lyaml_spec.yaml +++ b/specs/lib_lyaml_spec.yaml @@ -138,7 +138,12 @@ specify lyaml: - context scalars: - it recognizes null: ' expect (fn "~").to_equal {lyaml.null} - expect (fn "foo: ").to_equal {{foo = lyaml.null}}' + expect (fn "foo: ").to_equal {{foo = lyaml.null}} + expect (fn "foo: ~").to_equal {{foo = lyaml.null}} + expect (fn "foo: !!null").to_equal {{foo = lyaml.null}} + expect (fn "foo: null").to_equal {{foo = lyaml.null}} + expect (fn "foo: Null").to_equal {{foo = lyaml.null}} + expect (fn "foo: NULL").to_equal {{foo = lyaml.null}}' - it recognizes booleans: ' expect (fn "true").to_equal {true} expect (fn "false").to_equal {false} @@ -258,11 +263,11 @@ specify lyaml: - context a map: - it recognizes block mapping: | - expect (fn "null: ~\nboolean: yes\nnumber: 3.14"). + expect (fn "'null': ~\nboolean: yes\nnumber: 3.14"). to_equal {{null = lyaml.null, boolean = true, number = 3.14}} - it recognizes flow mapping: | - expect (fn "{null: ~, boolean: yes, number: 3.14}"). - to_equal {{null = lyaml.null, boolean = true, number = 3.14}} + expect (fn "{null: null, boolean: yes, number: 3.14}"). + to_equal {{[lyaml.null] = lyaml.null, boolean = true, number = 3.14}} - context with merge keys: - before: | merge = {x=1, y=2} diff --git a/specs/specs.mk b/specs/specs.mk index 727cdf2..c67c140 100644 --- a/specs/specs.mk +++ b/specs/specs.mk @@ -1,6 +1,6 @@ # Lyaml Specl make rules. # -# Copyright (c) 2013-2015 Gary V. Vaughan +# Copyright (C) 2013-2016 Gary V. Vaughan # Written by Gary V. Vaughan, 2013 # # This program is free software; you can redistribute it and/or modify it diff --git a/travis.yml.in b/travis.yml.in index 90a0e67..3d112ea 100644 --- a/travis.yml.in +++ b/travis.yml.in @@ -1,97 +1,29 @@ -language: c +language: python -env: - global: - - _COMPILE="libtool --mode=compile --tag=CC gcc" - - _CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_COMPAT_5_2 -DLUA_USE_LINUX" - - _INSTALL="libtool --mode=install install -p" - - _LINK="libtool --mode=link --tag=CC gcc" - - _LIBS="-lm -Wl,-E -ldl -lreadline" +sudo: false - - prefix=/usr/local - - bindir=$prefix/bin - - incdir=$prefix/include - - libdir=$prefix/lib +addons: + apt: + packages: + - help2man +env: + global: - _inst=$TRAVIS_BUILD_DIR/_inst - luadir=$_inst/share/lua - luaexecdir=$_inst/lib/lua matrix: - - LUA=lua5.3 - - LUA=lua5.2 - - LUA=lua5.1 - - LUA=luajit + - VLUA="lua=5.3" + - VLUA="lua=5.2" + - VLUA="lua=5.1" + - VLUA="luajit=2.1" + - VLUA="luajit=2.0" before_install: - # Put back the links for libyaml, which are missing on recent Travis VMs - - test -f /usr/lib/libyaml.so || - sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \; - - sudo apt-get install help2man - - # Fetch Lua sources. - - cd $TRAVIS_BUILD_DIR - - 'if test lua5.3 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.3.1.tar.gz | tar xz; - cd lua-5.3.1; - fi' - - 'if test lua5.2 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz; - cd lua-5.2.4; - fi' - - 'if test lua5.1 = "$LUA"; then - curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz; - cd lua-5.1.5; - fi' - - # Unpack, compile and install Lua. - - 'if test luajit = "$LUA"; then - curl http://luajit.org/download/LuaJIT-2.0.3.tar.gz | tar xz; - cd LuaJIT-2.0.3; - make && sudo make install; - for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do - if test -f /usr/local/include/luajit-2.0/$header; then - sudo ln -s /usr/local/include/luajit-2.0/$header /usr/local/include/$header; - fi; - done; - else - for src in src/*.c; do - test src/lua.c = "$src" || test src/luac.c = "$src" || eval $_COMPILE $_CFLAGS -c $src; - done; - eval $_LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo; - sudo mkdir -p $libdir; - eval sudo $_INSTALL lib$LUA.la $libdir/lib$LUA.la; - - eval $_COMPILE $_CFLAGS -c src/lua.c; - eval $_LINK -static -o $LUA lua.lo lib$LUA.la $_LIBS; - sudo mkdir -p $bindir; - eval sudo $_INSTALL $LUA $bindir/$LUA; - - sudo mkdir -p $incdir; - for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do - if test -f src/$header; then - eval sudo $_INSTALL src/$header $incdir/$header; - fi; - done; - fi' - - # Fetch LuaRocks. - - cd $TRAVIS_BUILD_DIR - - 'git clone https://github.com/keplerproject/luarocks.git luarocks-2.2.0' - - cd luarocks-2.2.0 - - git checkout v2.2.0 - - # Compile and install luarocks. - - if test luajit = "$LUA"; then - ./configure --lua-suffix=jit; - else - ./configure; - fi - - 'make build && sudo make install' - - # Tidy up file droppings. - - cd $TRAVIS_BUILD_DIR - - rm -rf lua-5.3.1 lua-5.2.4 lua-5.1.5 LuaJIT-2.0.3 luarocks-2.2.0 + - pip install hererocks + - hererocks here -r^ --$VLUA + - export PATH=$PWD/here/bin:$PATH install: @@ -99,7 +31,7 @@ install: - 'for rock in @EXTRA_ROCKS@""; do if test -z "$rock"; then break; fi; if luarocks list | grep "^$rock$" >/dev/null; then continue; fi; - sudo luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock; + luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock; done' # Fudge timestamps on release branches. @@ -114,20 +46,18 @@ install: # above when testing the git rockspec, both for enforcing backwards # compatibility by default, and for ease of maintenance. - if test -f '@PACKAGE@-@VERSION@-1.rockspec'; then - sudo luarocks make '@PACKAGE@-@VERSION@-1.rockspec' LUA="$LUA"; + luarocks make '@PACKAGE@-@VERSION@-1.rockspec'; else - sudo luarocks make --force '@PACKAGE@-git-1.rockspec' LUA="$LUA"; + luarocks make --force '@PACKAGE@-git-1.rockspec'; fi - # Clean up files created by root - - sudo git clean -dfx - - sudo rm -rf slingshot /tmp/ldoc - script: # Reconfigure for in-tree test install. - test -f configure || ./bootstrap --verbose - - ./configure --prefix="$_inst" --disable-silent-rules LUA="$LUA" + - LUA=`pwd`/here/bin/lua + LUA_INCLUDE=-I`pwd`/here/include + ./configure --prefix="$_inst" --disable-silent-rules # Verify luarocks installation. - make installcheck || make installcheck V=1