+2014-09-22 Colin Watson <cjwatson@debian.org>
+
+ Version: 1.3.1.
+
+ * lib/Makefile.am (libpipeline_la_LDFLAGS): Bump -version-info to
+ 4:1:3.
+
+2014-09-22 Colin Watson <cjwatson@debian.org>
+
+ Fix build on systems with neither setenv nor clearenv
+
+ Fixes Savannah bug #43265.
+
+ * lib/pipeline.c (clearenv): Don't define if defined(HAVE_SETENV),
+ as in that case gnulib will provide this symbol.
+ * lib/pipeline-private.h (clearenv): Likewise.
+ * NEWS: Document this.
+
+2014-09-17 Colin Watson <cjwatson@debian.org>
+
+ Make sure that the generated shared library has no undefined symbols
+
+ Based on a change found in
+ https://github.com/Alexpux/MSYS2-packages/tree/master/libpipeline.
+
+ * lib/Makefile.am (libpipeline_la_LDFLAGS): Add -no-undefined.
+
+2014-09-15 Colin Watson <cjwatson@debian.org>
+
+ Various autotools upgrades
+
+ * aclocal.m4: Upgrade to pkg-config 0.28 and Gettext 0.19.2.
+ * build-aux/config.sub: Upgrade to 2014-09-11.
+ * build-aux/ltmain.sh: Upgrade to Libtool 2.4.2-1.10 (from Debian).
+
+2014-08-03 Colin Watson <cjwatson@debian.org>
+
+ Update to config.guess 2014-03-23 and config.sub 2014-05-01.
+
+2014-04-24 Colin Watson <cjwatson@debian.org>
+
+ Fix test failures on Cygwin.
+
+ Reported by Chris J. Breisch.
+
+ * configure.ac: Define SHELL as a C preprocessor symbol.
+ * tests/basic.c (test_basic_wait_all, test_basic_setenv,
+ test_basic_unsetenv, test_basic_clearenv): Execute SHELL rather than
+ "sh".
+ * tests/exec.c (test_exec_process): Likewise.
+
+ * tests/basic.c (test_basic_args, test_basic_pipeline,
+ test_basic_unsetenv, test_basic_clearenv, test_basic_chdir,
+ test_basic_sequence): Check for pipeline_readline returning NULL.
+ * tests/inspect.c (test_inspect_pid): Likewise.
+ * tests/redirect.c (test_redirect_files): Likewise.
+
+ * NEWS: Document this.
+
2014-03-26 Colin Watson <cjwatson@debian.org>
Version: 1.3.0.
+libpipeline 1.3.1 (22 September 2014)
+=====================================
+
+Fix test failures on Cygwin.
+
+Fix build on systems with neither setenv nor clearenv, e.g. Solaris 8.
+
libpipeline 1.3.0 (26 March 2014)
=================================
fi[]dnl
])# PKG_CHECK_MODULES
-# po.m4 serial 21 (gettext-0.18.3)
-dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
+# po.m4 serial 22 (gettext-0.19)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Release version of the gettext macros. This is used to ensure that
dnl the gettext macros and po/Makefile.in.in are in sync.
- AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
dnl Perform the following tests also if --disable-nls has been given,
dnl because they are needed for "make dist" to work.
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-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."
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
- i*:MSYS*:*)
+ *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
exit ;;
- or32:Linux:*:*)
+ or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
exit ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
cat >&2 <<EOF
$0: unable to guess system type
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2013-08-10'
+timestamp='2014-09-11'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-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."
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or1k | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.10
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.7"
+VERSION="2.4.2 Debian-2.4.2-1.10"
TIMESTAMP=""
package_revision=1.3337
/* Define if vasnprintf exists but is overridden by gnulib. */
#undef REPLACE_VASNPRINTF
+/* A POSIX shell interpreter. */
+#undef SHELL
+
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
'sig_atomic_t'. */
#undef SIG_ATOMIC_T_SUFFIX
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libpipeline 1.3.0.
+# Generated by GNU Autoconf 2.69 for libpipeline 1.3.1.
#
# Report bugs to <cjwatson@debian.org>.
#
# Identity of this package.
PACKAGE_NAME='libpipeline'
PACKAGE_TARNAME='libpipeline'
-PACKAGE_VERSION='1.3.0'
-PACKAGE_STRING='libpipeline 1.3.0'
+PACKAGE_VERSION='1.3.1'
+PACKAGE_STRING='libpipeline 1.3.1'
PACKAGE_BUGREPORT='cjwatson@debian.org'
PACKAGE_URL=''
# 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 libpipeline 1.3.0 to adapt to many kinds of systems.
+\`configure' configures libpipeline 1.3.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libpipeline 1.3.0:";;
+ short | recursive ) echo "Configuration of libpipeline 1.3.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libpipeline configure 1.3.0
+libpipeline configure 1.3.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libpipeline $as_me 1.3.0, which was
+It was created by libpipeline $as_me 1.3.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='libpipeline'
- VERSION='1.3.0'
+ VERSION='1.3.1'
cat >>confdefs.h <<_ACEOF
fi
+cat >>confdefs.h <<_ACEOF
+#define SHELL "$SHELL"
+_ACEOF
+
+
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libpipeline $as_me 1.3.0, which was
+This file was extended by libpipeline $as_me 1.3.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libpipeline config.status 1.3.0
+libpipeline config.status 1.3.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
m4_pattern_forbid([^PIPELINE_])
# Initialise and check we're in the correct directory.
-AC_INIT([libpipeline], [1.3.0], [cjwatson@debian.org])
+AC_INIT([libpipeline], [1.3.1], [cjwatson@debian.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign])
AM_MAINTAINER_MODE
gl_WARN_ADD([-Wno-missing-field-initializers])
fi
AC_PROG_LN_S
+AC_DEFINE_UNQUOTED([SHELL], ["$SHELL"], [A POSIX shell interpreter.])
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [run_tests=yes], [run_tests=no])
AM_CONDITIONAL([RUN_TESTS], [test "x$run_tests" = xyes])
libpipeline_la_LDFLAGS = \
-export-symbols-regex '^(pipecmd|pipeline)_' \
- -version-info 4:0:3
+ -no-undefined \
+ -version-info 4:1:3
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpipeline.pc
libpipeline_la_LIBADD = ../gnulib/lib/libgnu.la $(LTLIBOBJS)
libpipeline_la_LDFLAGS = \
-export-symbols-regex '^(pipecmd|pipeline)_' \
- -version-info 4:0:3
+ -no-undefined \
+ -version-info 4:1:3
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libpipeline.pc
extern int debug_level;
extern void debug (const char *message, ...) PIPELINE_ATTR_FORMAT_PRINTF(1, 2);
-#ifndef HAVE_CLEARENV
+#if defined(HAVE_SETENV) && !defined(HAVE_CLEARENV)
extern int clearenv (void);
#endif
# endif
#endif
-#ifndef HAVE_CLEARENV
+#if defined(HAVE_SETENV) && !defined(HAVE_CLEARENV)
int clearenv (void)
{
/* According to:
"Number of arguments != 2");
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "foo\n"),
"Incorrect output from 'echo foo': '%s'", line);
fail_unless (pipeline_wait (p) == 0, "'echo foo' did not return 0");
"Number of arguments != 3");
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "foo bar\n"),
"Incorrect output from 'echo foo bar': '%s'", line);
fail_unless (pipeline_wait (p) == 0,
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "bar\n"),
"Incorrect output from 'echo foo | sed -e s/foo/bar/': "
"'%s'", line);
int n_statuses;
p = pipeline_new ();
- pipeline_command_args (p, "sh", "-c", "exit 2", NULL);
- pipeline_command_args (p, "sh", "-c", "exit 3", NULL);
+ pipeline_command_args (p, SHELL, "-c", "exit 2", NULL);
+ pipeline_command_args (p, SHELL, "-c", "exit 3", NULL);
pipeline_command_args (p, "true", NULL);
pipeline_start (p);
fail_unless (pipeline_wait_all (p, &statuses, &n_statuses) == 127);
{
pipeline *p;
- p = pipeline_new_command_args ("sh", "-c", "exit $TEST1", NULL);
+ p = pipeline_new_command_args (SHELL, "-c", "exit $TEST1", NULL);
pipecmd_setenv (pipeline_get_command (p, 0), "TEST1", "10");
fail_unless (pipeline_run (p) == 10, "TEST1 not set properly");
}
setenv ("TEST2", "foo", 1);
- p = pipeline_new_command_args ("sh", "-c", "echo $TEST2", NULL);
+ p = pipeline_new_command_args (SHELL, "-c", "echo $TEST2", NULL);
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "foo\n"),
"control returned '%s', expected 'foo\n'", line);
pipeline_wait (p);
pipeline_free (p);
- p = pipeline_new_command_args ("sh", "-c", "echo $TEST2", NULL);
+ p = pipeline_new_command_args (SHELL, "-c", "echo $TEST2", NULL);
pipecmd_unsetenv (pipeline_get_command (p, 0), "TEST2");
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "\n"),
"unsetenv failed: returned '%s', expected '\n'", line);
pipeline_wait (p);
setenv ("TEST3", "foo", 1);
- p = pipeline_new_command_args ("sh", "-c", "echo $TEST3; echo $TEST4",
+ p = pipeline_new_command_args (SHELL, "-c", "echo $TEST3; echo $TEST4",
NULL);
pipeline_want_out (p, -1);
pipeline_start (p);
line1 = pipeline_readline (p);
+ fail_unless (line1 != NULL);
fail_unless (!strcmp (line1, "foo\n"),
"control returned first line '%s', expected 'foo\n'",
line1);
line2 = pipeline_readline (p);
+ fail_unless (line2 != NULL);
fail_unless (!strcmp (line2, "\n"),
"control returned second line '%s', expected '\n'",
line2);
pipecmd_clearenv (pipeline_get_command (p, 0));
pipeline_start (p);
line1 = pipeline_readline (p);
+ fail_unless (line1 != NULL);
fail_unless (!strcmp (line1, "\n"),
"clearenv failed: returned first line '%s', expected '\n'",
line1);
line2 = pipeline_readline (p);
+ fail_unless (line2 != NULL);
fail_unless (!strcmp (line2, "\n"),
"clearenv returned second line '%s', expected '\n'",
line2);
pipecmd_setenv (pipeline_get_command (p, 0), "TEST4", "bar");
pipeline_start (p);
line1 = pipeline_readline (p);
+ fail_unless (line1 != NULL);
fail_unless (!strcmp (line1, "\n"),
"clearenv+setenv failed: returned first line '%s', expected '\n'",
line1);
line2 = pipeline_readline (p);
+ fail_unless (line2 != NULL);
fail_unless (!strcmp (line2, "bar\n"),
"clearenv+setenv returned second line '%s', expected 'bar\n'",
line2);
pipeline_want_out (p2, -1);
pipeline_start (p2);
line1 = pipeline_readline (p2);
+ fail_unless (line1 != NULL);
fail_unless (!strcmp (line1, "\n"),
"clearenv+setenv+dup failed: returned first line '%s', expected '\n'",
line1);
line2 = pipeline_readline (p2);
+ fail_unless (line2 != NULL);
fail_unless (!strcmp (line2, "bar\n"),
"clearenv+setenv+dup returned second line '%s', expected 'bar\n'",
line2);
START_TEST (test_basic_chdir)
{
pipeline *p;
+ const char *raw_line;
char *line, *end;
char *child_base, *expected_base;
pipecmd_chdir (pipeline_get_command (p, 0), temp_dir);
pipeline_want_out (p, -1);
pipeline_start (p);
- line = xstrdup (pipeline_readline (p));
+ raw_line = xstrdup (pipeline_readline (p));
+ fail_unless (raw_line != NULL);
+ line = xstrdup (raw_line);
end = line + strlen (line);
if (end > line && *(end - 1) == '\n')
*(end - 1) = '\0';
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "foo bar baz\n"));
pipeline_wait (p);
pipeline_free (p);
if (i < 2) {
char *arg;
- cmd = pipecmd_new_args ("sh", "-c", NULL);
+ cmd = pipecmd_new_args (SHELL, "-c", NULL);
arg = xasprintf ("exit %d", i);
pipecmd_arg (cmd, arg);
free (arg);
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
pid = (pid_t) atol (line);
fail_unless (pid == pipeline_get_pid (p, 0), "pids match");
/* Note that this test may hang if pipeline_get_pid does not work.
pipeline_want_out (p, -1);
pipeline_start (p);
line = pipeline_readline (p);
+ fail_unless (line != NULL);
fail_unless (!strcmp (line, "test data out\n"));
fclose (fh);