Commit graph

47 commits

Author SHA1 Message Date
Aleksey Cheusov
0d423c8876 updated to 0.18.0
Makefile:
    !!! "install-dirs" target has been renamed to "installdirs" !!!

    - At compile time MODULESDIR can contain a *list* of
      colon-separated directories,
      e.g. /usr/local/share/runawk:/usr/local/share/awk

  - power_getopt.awk, alt_getopt.awk and init_getopt.awk:
    - Support for multiply applied options, e.g. -vvv for increasing
      verbosity level. If option without arguments is multiply
      applied, getarg() function returns a number of times it was
      applied, not just 0 or 1.

  New modules:

    - init_getopt.awk using alt_getopt.awk and used by power_getopt.awk.
      Its goal is to initialize `long_opts' and `long_opts' variables
      but not run `getopt' function.

    - heapsort.awk  -  heapsort :-)
    - quicksort.awk - quicksort :-)
    - sort.awk      - either heapsort or quicksort,
                      the default is heapsort.
      Unfortunately GAWK's asort() and asorti() functions
      do *not* satisfy my needs. Another (and more important) reason
      is a portability.

  Improvements, clean-ups and fixes in regression tests.

  runawk-0-18-0 was successfully tested on the following platforms:
    NetBSD-5.0/x86, NetBSD-2.0/alpha, OpenBSD-4.5/x86,
    FreeBSD-7.1/x86, FreeBSD-7.1/spark, Linux/x86 and
    Darwin/ppc.
2009-11-11 18:19:13 +00:00
Aleksey Cheusov
4ebae9dae0 fix: two new files 2009-09-13 08:02:25 +00:00
Aleksey Cheusov
4ee90aa067 update to 0.17.0
MAJOR CHANGES
 -------------

 runawk:
    - ADDED: new option for runawk for #use'ing modules: -f.
      runawk can also be used for oneliners! ;-)

      runawk -f abs.awk -e 'BEGIN {print abs(-123); exit}'

    - In a multilined code passed to runawk using option -e, spaces
      are allowed before #directives.

    - After inventing alt_getopt.awk module there is no reason for
      heuristics that detects whether to add `-' to AWK arguments or
      not. So I've removed this heuristics. Use alt_getopt.awk module
      or other "smart" module for handling options correctly!

 alt_getopt.awk and power_getopt.awk:
    - FIX: for "abc:" short options specifier BSD and GNU getopt(3)
      accept "-acb" and understand it as "-a -cb", they also accept
      "-ac b" and also translate it to "-a -cb". Now alt_getopt.awk
      and power_getopt.awk work the same way.

 power_getopt.awk:
    - -h option doesn't print usage information, --help (and its short
      synonym) does.

 New modules:
    - shquote.awk, implementing shquote() function.
	shquote(str):
            `shquote' transforms the string `str' by adding shell
            escape and quoting characters to include it to the
            system() and popen() functions as an argument, so that
            the arguments will have the correct values after being
            evaluated by the shell.
        Inspired by NetBSD's shquote(3) from libc.

    - runcmd.awk, implementing functions runcmd1() and xruncmd1()
        runcmd1(CMD, OPTS, FILE):
            wrapper for function system() that runs a command CMD
            with options OPTS and one filename FILE.  Unlike
            system(CMD " " OPTS " " FILE) the function runcmd1()
            handles correctly FILE and CMD containing spaces, single
            quote, double quote, tilde etc.

        xruncmd1(FILE):
            safe wrapper for 'runcmd(1)'.
            awk exits with error if running command failed.

    - isnum.awk, implementing trivial isnum() function,
            see the source code.

    - alt_join.awk, implementing the following functions:
        join_keys(HASH, SEP):
            returns string consisting of all keys from HASH separated
            by SEP.

        join_values(HASH, SEP):
            returns string consisting of all values from HASH separated
            by SEP.

        join_by_numkeys (ARRAY, SEP [, START [, END]]):
            returns string consisting of all values from ARRAY
            separated by SEP. Indices from START (default: 1) to END
            (default: +inf) are analysed. Collecting values is stopped
            on index absent in ARRAY.
2009-09-12 13:02:25 +00:00
Aleksey Cheusov
1af3330502 LICENSE=mit 2009-08-10 20:27:36 +00:00
Aleksey Cheusov
64cabba466 remove @dirrm directive 2009-08-10 19:28:53 +00:00
Aleksey Cheusov
e418fa8fdc LINECSE=mit 2009-08-10 19:28:18 +00:00
Aleksey Cheusov
87b957ff9c minor clean-ups 2009-04-05 15:19:03 +00:00
Aleksey Cheusov
dd34abb60f Examples are also installed
Switch to AUTO_MKFS=yes
++pkgrevision
2009-04-05 14:51:08 +00:00
Aleksey Cheusov
0cf62a61c0 update to version 0.16.0
Lots of demo programs for most runawk modules were created and
  they are in examples/ subdirectory now.

  New MEGA module ;-) power_getopt.awk
  See the documentation and demo program examples/demo_power_getopt.
  It makes options handling REALLY easy.

  New modules:
      embed_str.awk
      has_suffix.awk
      has_prefix.awk
      readfile.awk
      modinfo.awk

  Minor fixes and improvements in dirname.awk and basename.awk.
  Now they are fully compatible with dirname(1) and basename(1)

  RUNAWK sets the following environment variables for the child awk
      subprocess:

      RUNAWK_MODC - A number of modules (-f filename) passed to AWK
      RUNAWK_MODV_<n> - Full path to the module #n,
          where n is in [0..RUNAWK_MODC) range.

  RUNAWK sets RUNAWK_ART_STDIN environment variable for the child awk
  subprocess to 1 if additional/artificial `-' was added to the list
  to awk's arguments.

  Makefile:
     bmake-ism were removed. Now Makefile is fully compatible with
     FreeBSD make.

     CLEANFILES target is used instead of hand-made rules

     Minor fix in 'test_all' target
2009-04-05 10:16:29 +00:00
Aleksey Cheusov
f73ff7b6c8 rewrite DESCR 2008-12-22 15:07:48 +00:00
Aleksey Cheusov
867e2b502f Update to 0.15.0
new module alt_getopt.awk that implements 'getopt' function
   compatible with "Utility Syntax Guidelines" described in
   "Single UNIX Specification"

   http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
   "getopt" function from this module is similar to C function getopt(3)
   (Idiotic GNU getopt(3) must die!)

   Better heuristics for adding `-' to the list awk's arguments,
   now it better conforms to "Utility Syntax Guidelines".

   Makefile: STDIN_FILENAME defaults to `-', not `/dev/stdin'
   Interix has no /dev/stdin file

   Makefile: WARNS=4 ====> WARNS?= 4
   Makefile: CPPFLAGS -> CFLAGS, FreeBSD make mk scripts
       don't support CPPFLAGS

   Lots of regression tests for 'getopt' function
2008-12-20 12:08:22 +00:00
Aleksey Cheusov
5119a20347 fixed: pkglint warning 2008-11-01 19:05:37 +00:00
Aleksey Cheusov
339be67d82 Fix for Interix: /dev/stdin -> - (there is no /dev/stdin in interix-3.5) 2008-10-23 18:12:08 +00:00
Aleksey Cheusov
d2d3744128 On Solaris "The Only True Awk" is used instead native sh*t, Gr-r-r-r /-) 2008-10-22 22:14:06 +00:00
Aleksey Cheusov
4af9a2099f update to 0.14.3
Major changes:

   The following code fails with nawk (seen on NetBSD)
                  runawk -e ' { print "123" } ' /dev/null
     It says
                  /usr/bin/awk: can't open file --
                   source line number 7
     This happens because nawk treats `--' after program as a generic file.

   fixed: compilation bug under FreeBSD (WARNS=4 -> warning -> error)
   caused by comparison of signed with unsigned

   More verbose output when stat(filename) failed

   modules/str2regexp.awk: adapted to buggy MAWK
2008-10-19 10:15:56 +00:00
Aleksey Cheusov
5730466918 updated to version 0.14.2
Major changes:
      Temporary file is removed if runawk is killed by
      SIGINT, SIGQUIT, SIGTERM, SIGHUP or SIGPIPE signals.
      (Temporary file is created by 'runawk -e ...')
2008-08-29 19:59:07 +00:00
Aleksey Cheusov
951c3480e0 fixed: pkglint warning 2008-08-28 19:51:06 +00:00
Aleksey Cheusov
04bbc19bdc updated to version 0.14.1
======================================================================
  Version 0.14.1, by Aleksey Cheusov, Sat, 19 Jul 2008 22:53:45 +0300

    FIXED: The following code doesn't work with runawk-0.14.0
        runawk -e '
        #use "anymodule.awk"

        <ANY_CODE_HERE>
        '

        This code requires a creation of the temporary file that was
        removed in runawk-0.14.0. Now temporary file is created using
        mkstemp(3).

        Regression tests are created for testing.

  ======================================================================
  Version 0.14.0, by Aleksey Cheusov, Sat, 12 Jul 2008 17:29:22 +0300

    Temporary file is not needed anymore for -e option.

    FIXED: #env didn't work under Linux/glibc.

    FIXED: compilation error under FreeBSD.

    Lots of new regression tests. Code clean-ups.
    fgetln is not required anymore. No hacks about it.

    If error happens while processing a #directive,
    a correct line number is output
2008-07-19 20:47:38 +00:00
Aleksey Cheusov
3db4d525cc update to version 0.13.0
ADDED: option -v|--assign that works like AWK's -v option.
    This is to pass some variables to AWK interpreter.
    Example: runawk -v var=123 -e 'BEGIN {print var }'

    modules/xgetline.awk: better error message/clean-ups

    modules/abort.awk: NR is also printed to stderr

    minor fixes in *.c

    clean-ups and fixes in 'make test'. Now it doesn't depend on my
    own system and runawk directory

    'make test' exits with non-zero exit status if regression tests
    fail

    Makefile: ported to ancient pmake-1.45 found in some Linux distros
2008-06-15 13:36:15 +00:00
Aleksey Cheusov
cccbe134e6 default (upstream) WARNS=n is used
++pkgrevision
2008-05-29 21:26:42 +00:00
Aleksey Cheusov
d3a0ae34a6 fixed: pkglint warning 2008-03-30 00:19:16 +00:00
Aleksey Cheusov
9d32576662 fix: more INSTALLATION_DIRS (DESTDIR) 2008-03-29 22:20:08 +00:00
Aleksey Cheusov
6e999ec223 WARNS=4 is too high: bug found with gcc-4.1.2 under Linux 2008-03-04 16:35:03 +00:00
Aleksey Cheusov
6feb71b7d9 updated to runawk-0.12.1 (fix alt_assert.awk) 2008-03-03 23:20:50 +00:00
Aleksey Cheusov
4ca6add401 updated to the latest upstream release 0.12.0
For news - see NEWS file.
2008-03-03 21:59:31 +00:00
Tobias Nygren
ed892d8f1e Revert my previous change. 2008-02-10 17:37:25 +00:00
Tobias Nygren
93805e720e Needs GNU nroff to generate catpages. 2008-02-07 13:48:35 +00:00
Aleksey Cheusov
0af8d4a9a9 USE_BSD_MAKEFILE=yes 2008-02-05 10:13:08 +00:00
Aleksey Cheusov
c64db98182 update to the latest upstream release 0.10.1
FIXED: If AWK interpreter segfaults or killed by any other signal,
    runawk exits with exit status 0.  Affected runawk versions: all.
    Now this is fixed and runawk exits with exit status 128+SIGNAL
    just like many shells.

    EXIT STATUS section has been added to the manual page.
2008-02-01 19:44:00 +00:00
Aleksey Cheusov
0ee8d8a030 Upgraded to the latest upstream release 0.10.0.
Major changes:

    ADDED: The environment variable RUNAWK_AWKPROG overrides
    the default awk interpreter which is set at compile time.
    Documentation updated accordingly.

    FIXED: unsafe use of strdup(3)

    I've copied MIT License text to code from www.opensource.org.
    Do you see any difference?

    ADDED: new trivial module pow.awk that implements function "pow"

    fix: MKMAN and MKCATPAGES make's standard variables are checked
    during installation

    In order to build runawk not in a directory you can either build
    it like this (standard way)
        cd /src/dir; make all install MAKEOBJDIR=/obj/dir
    or like this
        cd /obj/dir; make -f /src/dir/Makefile all install

    optional config.h is #included if you need it

    other minor fixes and improvements both in code and documentation
2008-01-23 20:02:54 +00:00
Aleksey Cheusov
29e2c09825 Upgraded to the latest upstream release 0.10.0 2008-01-23 19:58:19 +00:00
Aleksey Cheusov
3b5bc95ff4 FIX: now runawk is built correctly if PKGMANDIR=share/man or whatever else 2008-01-06 11:30:00 +00:00
Aleksey Cheusov
f35933ee35 ${PKGBASE} -> runawk 2007-12-31 10:33:27 +00:00
Aleksey Cheusov
5be5a5af90 no AUTO_MKDIRS, now this package can be built with pkgsrc-2007Q3 too 2007-12-31 09:38:28 +00:00
Aleksey Cheusov
0a3e06d832 @dirrm added 2007-12-31 09:37:18 +00:00
Aleksey Cheusov
8c989c5bef fix for Linux and others: MKCATPAGES=no 2007-12-23 23:55:47 +00:00
Aleksey Cheusov
5269292ecc fixed: pkglint warning 2007-12-23 21:59:02 +00:00
Aleksey Cheusov
d9b17ad00e updated to latest upstream release 0.9.0
NEWS:
    I switched to BSD make. I really hate automake and its approach in
    general. I'm not expert in BSD, but their 'make' looks much
    better. But using it makes some changes in building process, see
    README/INSTALLATION section for a brief description.

    ADDED: man page for runawk. HTML version runawk.html can also be
    generated from runawk.pod using pod2html, see Makefile.

    ADDED: -i/-I options for forcing/disabling adding /dev/stdin to
    the list of awk arguments. See man page for more information.

    A few AWK modules are installed to PREFIX/share/runawk: abs.awk,
    min.awk, max.awk and alt_assert.awk. This directory is also checked
    while searching for modules. See man page for more details.

    AWK_PROG and STDIN_FILENAME Makefile variables can be passed to make
    program to change a path to an actual AWK interpreter (/usr/bin/awk
    by default) and stdin file (/dev/stdin by default).

    Lots of improvements in documentation

    ADDED: regression tests. Run them by running 'make test' and let
    me know if somethiung fails.

    debugging output is sent stdout, not stderr

    ADDED: long synonyms for short options, --help, --version etc.

    clean-ups in Makefile

    options handling improvements
2007-12-23 21:38:17 +00:00
Aleksey Cheusov
8779cd7d0c fixed: two pkglint warnings 2007-11-02 22:12:45 +00:00
Aleksey Cheusov
1c2565780b update to the recent version 0.8.1
FIXED: default stdin file should be /std/stdin, not /dev/stderr (typo)
2007-10-24 12:50:30 +00:00
Aleksey Cheusov
5f599382e7 clean-ups 2007-10-21 16:02:35 +00:00
Aleksey Cheusov
bec9b22f40 WARFLAGS is set to empty string for non-gcc compilers 2007-10-21 15:43:12 +00:00
Aleksey Cheusov
2e97093cad DESTDIR support 2007-10-21 15:38:30 +00:00
Aleksey Cheusov
f87f992bbd use upstream target "install" 2007-10-21 15:34:58 +00:00
Aleksey Cheusov
11cd28cb3e updated to the latest upstream release
NEWS:

   FIXED: return code of execvp is not analysed, i.e. when running
   an interpreter fails, runawk silently exits with zero exit status.
   Now it fails with exit status 1 and print an error to stderr.

   stdin filename defaults to "/dev/stdin"

   ROOT variable in Makefile has been renamed
   to more commonly used PREFIX

   realloc(2) is not used anymore. arrays[ARRAY_SZ] are used now.

   AWK and STDIN_FILENAME variables are removed from Makefile.
   Use CPPFLAGS for changing defaults.
2007-10-21 15:28:55 +00:00
Aleksey Cheusov
5f96570778 STDIN_FILENAME=/dev/stdin is added to MAKE_FLAGS 2007-10-14 19:01:23 +00:00
Aleksey Cheusov
31ef93efe0 runawk - Small wrapper for AWK interpreter that implements modules for AWK 2007-09-29 11:21:07 +00:00