pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc xargs(1) on Interix is broken. It executes the utility...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2189011de88b
branches:  trunk
changeset: 530580:2189011de88b
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun Jul 01 23:27:43 2007 +0000

description:
xargs(1) on Interix is broken. It executes the utility on the command line
even if standard input is the empty string. Install a wrapper script
bundled with pkgtools/bootstrap-extras to deal with this. This is an
attempt at a permanent workaround for the problem described in PR pkg/25777
which has regressed since it was initially fixed.

We can now bootstrap again on Interix 3.5.

diffstat:

 bootstrap/bootstrap                      |  10 +++++++++-
 pkgtools/bootstrap-extras/Makefile       |  14 ++++++++++++--
 pkgtools/bootstrap-extras/PLIST          |   3 ++-
 pkgtools/bootstrap-extras/files/xargs-sh |  13 +++++++++++++
 4 files changed, 36 insertions(+), 4 deletions(-)

diffs (95 lines):

diff -r e0842463c093 -r 2189011de88b bootstrap/bootstrap
--- a/bootstrap/bootstrap       Sun Jul 01 22:45:58 2007 +0000
+++ b/bootstrap/bootstrap       Sun Jul 01 23:27:43 2007 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.98 2007/05/30 01:42:59 schmonz Exp $
+# $NetBSD: bootstrap,v 1.99 2007/07/01 23:27:43 tnn Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -489,6 +489,7 @@
        need_awk=yes
        need_sed=yes
        set_opsys=no
+       need_xargs=yes
        # only used for unprivileged builds
        groupsprog="id -gn"
        # for bootstrap only; pkgsrc uses CPPFLAGS
@@ -771,6 +772,13 @@
        need_extras=yes
 fi
 
+if [ "$need_xargs" = "yes" ]; then
+       echo_msg "Installing fixed xargs script"
+       run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $prefix/bin/xargs"
+       echo "TOOLS_PLATFORM.xargs?=            $prefix/bin/xargs" >> ${MKCONF_EXAMPLE}
+       need_extras=yes
+fi
+
 echo_msg "Installing bmake"
 copy_src $pkgsrcdir/devel/bmake/files bmake
 run_cmd "(cd $wrkdir/bmake && env CPPFLAGS='$CPPFLAGS -I../../libnbcompat' LDFLAGS='$LDFLAGS -L../../libnbcompat' LIBS='-lnbcompat' $bmakexenv $shprog ./boot-strap $configure_quiet_flags -q -o 
$opsys --prefix=$prefix --sysconfdir=$sysconfdir --mksrc none --with-default-sys-path="$prefix/share/mk" $bmakexargs)"
diff -r e0842463c093 -r 2189011de88b pkgtools/bootstrap-extras/Makefile
--- a/pkgtools/bootstrap-extras/Makefile        Sun Jul 01 22:45:58 2007 +0000
+++ b/pkgtools/bootstrap-extras/Makefile        Sun Jul 01 23:27:43 2007 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.2 2006/08/24 17:46:53 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2007/07/01 23:27:43 tnn Exp $
 
-DISTNAME=      bootstrap-extra-files-20060824
+DISTNAME=      bootstrap-extra-files-20070202
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -30,6 +30,11 @@
 NEED_STRIP.*=          "@comment "
 PLIST_SUBST+=          NEED_STRIP=${NEED_STRIP}
 
+OPSYSVARS+=            NEED_XARGS
+NEED_XARGS.Interix=    # empty
+NEED_XARGS.*=          "@comment "
+PLIST_SUBST+=          NEED_XARGS=${NEED_XARGS}
+
 do-extract:
        ${CP} -R ${FILESDIR} ${WRKSRC}
 
@@ -49,5 +54,10 @@
                ${INSTALL_SCRIPT} ${WRKSRC}/strip-sh                    \
                        ${PREFIX}/bin/strip;                            \
        fi
+       if ${TEST} -z ${NEED_XARGS:M*:Q}""; then                        \
+               ${INSTALL_SCRIPT_DIR} ${PREFIX}/bin;                    \
+               ${INSTALL_SCRIPT} ${WRKSRC}/xargs-sh                    \
+                       ${PREFIX}/bin/xargs;                            \
+       fi
 
 .include "../../mk/bsd.pkg.mk"
diff -r e0842463c093 -r 2189011de88b pkgtools/bootstrap-extras/PLIST
--- a/pkgtools/bootstrap-extras/PLIST   Sun Jul 01 22:45:58 2007 +0000
+++ b/pkgtools/bootstrap-extras/PLIST   Sun Jul 01 23:27:43 2007 +0000
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2006/07/17 14:21:31 jlam Exp $
+@comment $NetBSD: PLIST,v 1.2 2007/07/01 23:27:43 tnn Exp $
 ${NEED_MKDIR}bin/mkdir-sh
 ${NEED_STRIP}bin/strip
 ${NEED_FAKELDD}sbin/fakeldd
+${NEED_XARGS}bin/xargs
diff -r e0842463c093 -r 2189011de88b pkgtools/bootstrap-extras/files/xargs-sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/bootstrap-extras/files/xargs-sh  Sun Jul 01 23:27:43 2007 +0000
@@ -0,0 +1,13 @@
+#! /bin/sh
+#
+# $NetBSD: xargs-sh,v 1.1 2007/07/01 23:27:43 tnn Exp $
+#
+# xargs(1) on Interix is broken. It executes the utility on the command line
+# even if standard input is the empty string.
+
+d="`/bin/cat`"
+if [ "$d" != "" ]
+then
+echo "$d" | /bin/xargs $@
+exit $?
+fi



Home | Main Index | Thread Index | Old Index