head	1.2;
access;
symbols
	netbsd-11-0-RC7:1.1.1.6.6.1
	netbsd-11-0-RC6:1.1.1.6.6.1
	netbsd-11-0-RC5:1.1.1.6.6.1
	netbsd-11-0-RC4:1.1.1.6
	netbsd-11-0-RC3:1.1.1.6
	netbsd-11-0-RC2:1.1.1.6
	netbsd-11-0-RC1:1.1.1.6
	perseant-exfatfs-base-20250801:1.1.1.6
	netbsd-11:1.1.1.6.0.6
	netbsd-11-base:1.1.1.6
	expat-2-7-1:1.1.1.6
	expat-2-7-0:1.1.1.6
	netbsd-10-1-RELEASE:1.1.1.6
	perseant-exfatfs-base-20240630:1.1.1.6
	perseant-exfatfs:1.1.1.6.0.4
	perseant-exfatfs-base:1.1.1.6
	netbsd-8-3-RELEASE:1.1.1.4.4.1
	netbsd-9-4-RELEASE:1.1.1.4.14.1
	netbsd-10-0-RELEASE:1.1.1.6
	netbsd-10-0-RC6:1.1.1.6
	netbsd-10-0-RC5:1.1.1.6
	netbsd-10-0-RC4:1.1.1.6
	netbsd-10-0-RC3:1.1.1.6
	netbsd-10-0-RC2:1.1.1.6
	netbsd-10-0-RC1:1.1.1.6
	netbsd-10:1.1.1.6.0.2
	netbsd-10-base:1.1.1.6
	netbsd-9-3-RELEASE:1.1.1.4.14.1
	expat-2-4-6:1.1.1.6
	cjep_sun2x-base1:1.1.1.5
	cjep_sun2x:1.1.1.5.0.6
	cjep_sun2x-base:1.1.1.5
	cjep_staticlib_x-base1:1.1.1.5
	netbsd-9-2-RELEASE:1.1.1.4.14.1
	cjep_staticlib_x:1.1.1.5.0.4
	cjep_staticlib_x-base:1.1.1.5
	netbsd-9-1-RELEASE:1.1.1.4.14.1
	phil-wifi-20200421:1.1.1.5
	phil-wifi-20200411:1.1.1.5
	is-mlppp:1.1.1.5.0.2
	is-mlppp-base:1.1.1.5
	phil-wifi-20200406:1.1.1.5
	netbsd-8-2-RELEASE:1.1.1.4.4.1
	netbsd-9-0-RELEASE:1.1.1.4.14.1
	netbsd-9-0-RC2:1.1.1.4.14.1
	netbsd-9-0-RC1:1.1.1.4.14.1
	phil-wifi-20191119:1.1.1.5
	expat-2-2-8:1.1.1.5
	netbsd-9:1.1.1.4.0.14
	netbsd-9-base:1.1.1.4
	phil-wifi-20190609:1.1.1.4
	netbsd-8-1-RELEASE:1.1.1.4
	netbsd-8-1-RC1:1.1.1.4
	pgoyette-compat-merge-20190127:1.1.1.4
	pgoyette-compat-20190127:1.1.1.4
	pgoyette-compat-20190118:1.1.1.4
	pgoyette-compat-1226:1.1.1.4
	pgoyette-compat-1126:1.1.1.4
	pgoyette-compat-1020:1.1.1.4
	pgoyette-compat-0930:1.1.1.4
	pgoyette-compat-0906:1.1.1.4
	netbsd-7-2-RELEASE:1.1.1.2.12.2
	pgoyette-compat-0728:1.1.1.4
	netbsd-8-0-RELEASE:1.1.1.4
	phil-wifi:1.1.1.4.0.12
	phil-wifi-base:1.1.1.4
	pgoyette-compat-0625:1.1.1.4
	netbsd-8-0-RC2:1.1.1.4
	pgoyette-compat-0521:1.1.1.4
	pgoyette-compat-0502:1.1.1.4
	pgoyette-compat-0422:1.1.1.4
	netbsd-8-0-RC1:1.1.1.4
	pgoyette-compat-0415:1.1.1.4
	pgoyette-compat-0407:1.1.1.4
	pgoyette-compat-0330:1.1.1.4
	pgoyette-compat-0322:1.1.1.4
	pgoyette-compat-0315:1.1.1.4
	netbsd-7-1-2-RELEASE:1.1.1.2.12.2
	pgoyette-compat:1.1.1.4.0.10
	pgoyette-compat-base:1.1.1.4
	netbsd-7-1-1-RELEASE:1.1.1.2.12.2
	matt-nb8-mediatek:1.1.1.4.0.8
	matt-nb8-mediatek-base:1.1.1.4
	perseant-stdc-iso10646:1.1.1.4.0.6
	perseant-stdc-iso10646-base:1.1.1.4
	expat-2-2-1:1.1.1.4
	netbsd-8:1.1.1.4.0.4
	netbsd-8-base:1.1.1.4
	prg-localcount2-base3:1.1.1.4
	prg-localcount2-base2:1.1.1.4
	prg-localcount2-base1:1.1.1.4
	prg-localcount2:1.1.1.4.0.2
	prg-localcount2-base:1.1.1.4
	pgoyette-localcount-20170426:1.1.1.4
	bouyer-socketcan-base1:1.1.1.4
	pgoyette-localcount-20170320:1.1.1.4
	netbsd-7-1:1.1.1.2.12.2.0.2
	netbsd-7-1-RELEASE:1.1.1.2.12.2
	netbsd-7-1-RC2:1.1.1.2.12.2
	expat-2-2-0:1.1.1.4
	netbsd-7-nhusb-base-20170116:1.1.1.2.12.1
	bouyer-socketcan:1.1.1.3.0.4
	bouyer-socketcan-base:1.1.1.3
	pgoyette-localcount-20170107:1.1.1.3
	netbsd-7-1-RC1:1.1.1.2.12.1
	pgoyette-localcount-20161104:1.1.1.3
	netbsd-7-0-2-RELEASE:1.1.1.2.14.1
	localcount-20160914:1.1.1.3
	netbsd-7-nhusb:1.1.1.2.12.1.0.2
	netbsd-7-nhusb-base:1.1.1.2.12.1
	pgoyette-localcount-20160806:1.1.1.3
	pgoyette-localcount-20160726:1.1.1.3
	pgoyette-localcount:1.1.1.3.0.2
	pgoyette-localcount-base:1.1.1.3
	netbsd-7-0-1-RELEASE:1.1.1.2.14.1
	expat-2-1-1:1.1.1.3
	netbsd-7-0:1.1.1.2.0.14
	netbsd-7-0-RELEASE:1.1.1.2
	netbsd-7-0-RC3:1.1.1.2
	netbsd-7-0-RC2:1.1.1.2
	netbsd-7-0-RC1:1.1.1.2
	netbsd-6-0-6-RELEASE:1.1.1.1
	netbsd-6-1-5-RELEASE:1.1.1.1
	netbsd-7:1.1.1.2.0.12
	netbsd-7-base:1.1.1.2
	yamt-pagecache-base9:1.1.1.2
	yamt-pagecache-tag8:1.1.1.2.2.2
	netbsd-6-1-4-RELEASE:1.1.1.1
	netbsd-6-0-5-RELEASE:1.1.1.1
	tls-earlyentropy:1.1.1.2.0.10
	tls-earlyentropy-base:1.1.1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2
	riastradh-drm2-base3:1.1.1.2
	netbsd-6-1-3-RELEASE:1.1.1.1
	netbsd-6-0-4-RELEASE:1.1.1.1
	netbsd-6-1-2-RELEASE:1.1.1.1
	netbsd-6-0-3-RELEASE:1.1.1.1
	netbsd-6-1-1-RELEASE:1.1.1.1
	riastradh-drm2-base2:1.1.1.2
	riastradh-drm2-base1:1.1.1.2
	riastradh-drm2:1.1.1.2.0.6
	riastradh-drm2-base:1.1.1.2
	netbsd-6-1:1.1.1.1.0.8
	netbsd-6-0-2-RELEASE:1.1.1.1
	netbsd-6-1-RELEASE:1.1.1.1
	netbsd-6-1-RC4:1.1.1.1
	netbsd-6-1-RC3:1.1.1.1
	agc-symver:1.1.1.2.0.8
	agc-symver-base:1.1.1.2
	netbsd-6-1-RC2:1.1.1.1
	netbsd-6-1-RC1:1.1.1.1
	yamt-pagecache-base8:1.1.1.2
	netbsd-6-0-1-RELEASE:1.1.1.1
	yamt-pagecache-base7:1.1.1.2
	matt-nb6-plus-nbase:1.1.1.1
	yamt-pagecache-base6:1.1.1.2
	netbsd-6-0:1.1.1.1.0.6
	netbsd-6-0-RELEASE:1.1.1.1
	netbsd-6-0-RC2:1.1.1.1
	tls-maxphys:1.1.1.2.0.4
	tls-maxphys-base:1.1.1.2
	matt-nb6-plus:1.1.1.1.0.4
	matt-nb6-plus-base:1.1.1.1
	netbsd-6-0-RC1:1.1.1.1
	yamt-pagecache-base5:1.1.1.2
	yamt-pagecache:1.1.1.2.0.2
	yamt-pagecache-base4:1.1.1.2
	expat-2-1-0:1.1.1.2
	netbsd-6:1.1.1.1.0.2
	netbsd-6-base:1.1.1.1
	expat-2-0-1:1.1.1.1
	expat:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2026.06.13.16.50.53;	author jdc;	state dead;
branches;
next	1.1;
commitid	Fg5Ae2fwu3t5TEJG;

1.1
date	2012.02.11.18.18.24;	author tron;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2012.02.11.18.18.24;	author tron;	state Exp;
branches
	1.1.1.1.2.1
	1.1.1.1.6.1
	1.1.1.1.8.1;
next	1.1.1.2;

1.1.1.2
date	2012.04.06.10.23.13;	author spz;	state Exp;
branches
	1.1.1.2.2.1
	1.1.1.2.12.1
	1.1.1.2.14.1;
next	1.1.1.3;

1.1.1.3
date	2016.05.14.14.30.42;	author spz;	state Exp;
branches
	1.1.1.3.2.1
	1.1.1.3.4.1;
next	1.1.1.4;
commitid	t3RrSVHO5XBpss6z;

1.1.1.4
date	2017.02.04.10.16.05;	author spz;	state Exp;
branches
	1.1.1.4.4.1
	1.1.1.4.12.1
	1.1.1.4.14.1;
next	1.1.1.5;
commitid	B9FyZD57dziavCEz;

1.1.1.5
date	2019.09.16.06.21.04;	author maya;	state Exp;
branches;
next	1.1.1.6;
commitid	UzhqcAQ3PxywwcDB;

1.1.1.6
date	2022.02.23.15.21.35;	author christos;	state Exp;
branches
	1.1.1.6.6.1;
next	;
commitid	ZsvHjokwGdDtSKtD;

1.1.1.1.2.1
date	2016.05.18.10.49.23;	author snj;	state Exp;
branches;
next	1.1.1.1.2.2;
commitid	rBQKbLw2qANU6X6z;

1.1.1.1.2.2
date	2017.02.19.07.28.11;	author snj;	state Exp;
branches;
next	;
commitid	idwY0ZKxoPwU5xGz;

1.1.1.1.6.1
date	2016.05.18.10.40.42;	author snj;	state Exp;
branches;
next	1.1.1.1.6.2;
commitid	sn3ewMlOwSnM3X6z;

1.1.1.1.6.2
date	2017.02.19.07.25.35;	author snj;	state Exp;
branches;
next	;
commitid	jAh0mhd653b05xGz;

1.1.1.1.8.1
date	2016.05.18.10.45.13;	author snj;	state Exp;
branches;
next	1.1.1.1.8.2;
commitid	5xlzCAOqLNUu5X6z;

1.1.1.1.8.2
date	2017.02.19.07.26.19;	author snj;	state Exp;
branches;
next	;
commitid	Dgy5ClmXEzfe5xGz;

1.1.1.2.2.1
date	2012.04.06.10.23.13;	author yamt;	state dead;
branches;
next	1.1.1.2.2.2;

1.1.1.2.2.2
date	2012.04.17.00.04.41;	author yamt;	state Exp;
branches;
next	;

1.1.1.2.12.1
date	2016.05.18.09.14.15;	author snj;	state Exp;
branches
	1.1.1.2.12.1.2.1;
next	1.1.1.2.12.2;
commitid	L9D8vOB1Fk8fAW6z;

1.1.1.2.12.2
date	2017.02.19.04.53.23;	author snj;	state Exp;
branches;
next	;
commitid	818vp37ghTFMewGz;

1.1.1.2.12.1.2.1
date	2017.03.13.07.41.23;	author skrll;	state Exp;
branches;
next	;
commitid	vH6VFbpxnMy7rmJz;

1.1.1.2.14.1
date	2016.05.18.09.15.16;	author snj;	state Exp;
branches;
next	1.1.1.2.14.2;
commitid	QP6HLZ4lDbRvAW6z;

1.1.1.2.14.2
date	2017.02.19.04.52.28;	author snj;	state Exp;
branches;
next	;
commitid	R7ppK1AfEy3newGz;

1.1.1.3.2.1
date	2017.03.20.06.56.46;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.1.1.3.4.1
date	2017.04.21.16.52.56;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.1.1.4.4.1
date	2019.09.17.18.50.05;	author martin;	state Exp;
branches;
next	;
commitid	YklLl72xalI1EoDB;

1.1.1.4.12.1
date	2020.04.13.08.02.21;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.1.1.4.14.1
date	2019.09.17.19.51.13;	author martin;	state Exp;
branches;
next	;
commitid	JZUctABQ1ZKdZoDB;

1.1.1.6.6.1
date	2026.06.16.08.23.20;	author martin;	state dead;
branches;
next	;
commitid	CEh2BY99NRqLYZJG;


desc
@@


1.2
log
@Merge expat 2.8.1
@
text
@#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission.  M.I.T. makes no representations about the
# suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.  It can only install one file at a time, a restriction
# shared with many OS's install programs.


# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"


# put in absolute paths if you don't have them in your path; or use env. vars.

mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"

transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""

while [ x"$1" != x ]; do
    case $1 in
	-c) instcmd="$cpprog"
	    shift
	    continue;;

	-d) dir_arg=true
	    shift
	    continue;;

	-m) chmodcmd="$chmodprog $2"
	    shift
	    shift
	    continue;;

	-o) chowncmd="$chownprog $2"
	    shift
	    shift
	    continue;;

	-g) chgrpcmd="$chgrpprog $2"
	    shift
	    shift
	    continue;;

	-s) stripcmd="$stripprog"
	    shift
	    continue;;

	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
	    shift
	    continue;;

	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
	    shift
	    continue;;

	*)  if [ x"$src" = x ]
	    then
		src=$1
	    else
		# this colon is to work around a 386BSD /bin/sh bug
		:
		dst=$1
	    fi
	    shift
	    continue;;
    esac
done

if [ x"$src" = x ]
then
	echo "install:	no input file specified"
	exit 1
else
	true
fi

if [ x"$dir_arg" != x ]; then
	dst=$src
	src=""
	
	if [ -d $dst ]; then
		instcmd=:
		chmodcmd=""
	else
		instcmd=mkdir
	fi
else

# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad 
# if $src (and thus $dsttmp) contains '*'.

	if [ -f $src -o -d $src ]
	then
		true
	else
		echo "install:  $src does not exist"
		exit 1
	fi
	
	if [ x"$dst" = x ]
	then
		echo "install:	no destination specified"
		exit 1
	else
		true
	fi

# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic

	if [ -d $dst ]
	then
		dst="$dst"/`basename $src`
	else
		true
	fi
fi

## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`

# Make sure that the destination directory exists.
#  this part is taken from Noah Friedman's mkinstalldirs script

# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='	
'
IFS="${IFS-${defaultIFS}}"

oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@@/@@%@@g' -e 's@@^%@@/@@'`
IFS="${oIFS}"

pathcomp=''

while [ $# -ne 0 ] ; do
	pathcomp="${pathcomp}${1}"
	shift

	if [ ! -d "${pathcomp}" ] ;
        then
		$mkdirprog "${pathcomp}"
	else
		true
	fi

	pathcomp="${pathcomp}/"
done
fi

if [ x"$dir_arg" != x ]
then
	$doit $instcmd $dst &&

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else

# If we're going to rename the final executable, determine the name now.

	if [ x"$transformarg" = x ] 
	then
		dstfile=`basename $dst`
	else
		dstfile=`basename $dst $transformbasename | 
			sed $transformarg`$transformbasename
	fi

# don't allow the sed command to completely eliminate the filename

	if [ x"$dstfile" = x ] 
	then
		dstfile=`basename $dst`
	else
		true
	fi

# Make a temp file name in the proper directory.

	dsttmp=$dstdir/#inst.$$#

# Move or copy the file name to the temp name

	$doit $instcmd $src $dsttmp &&

	trap "rm -f ${dsttmp}" 0 &&

# and set any options; do chmod last to preserve setuid bits

# If any of these fail, we abort the whole thing.  If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.

	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&

# Now rename the file to the real destination.

	$doit $rmcmd -f $dstdir/$dstfile &&
	$doit $mvcmd $dsttmp $dstdir/$dstfile 

fi &&


exit 0
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Initial import of "expat" 2.0.1 into base:
This is James Clark's expat XML parser library in C. It is a stream
oriented parser that requires setting handlers to deal with the
structure that the parser discovers in the document.

This is the first part of the fix for PR lib/40346.
@
text
@@


1.1.1.1.2.1
log
@Pull up following revision(s) (requested by spz in ticket #1383):
	distrib/sets/lists/base/ad.mips64eb: patch
	distrib/sets/lists/base/ad.mips64el: patch
	distrib/sets/lists/base/md.amd64: patch
	distrib/sets/lists/base/md.sparc64: patch
	distrib/sets/lists/base/shl.mi: 1.771, 1.772 via patch
	distrib/sets/lists/comp/ad.mips64eb: patch
	distrib/sets/lists/comp/ad.mips64el: patch
	distrib/sets/lists/comp/md.amd64: patch
	distrib/sets/lists/comp/md.sparc64: patch
	distrib/sets/lists/comp/mi: 1.2035 via patch
	distrib/sets/lists/comp/shl.mi: patch
	external/mit/expat/dist/CMake.README: up to 1.1.1.2
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.3
	external/mit/expat/dist/ConfigureChecks.cmake: up to 1.1.1.1
	external/mit/expat/dist/MANIFEST: up to 1.1.1.3
	external/mit/expat/dist/Makefile.in: up to 1.1.1.3
	external/mit/expat/dist/README: up to 1.1.1.3
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.3
	external/mit/expat/dist/configure.ac: up to 1.1.1.1
	external/mit/expat/dist/configure.in: up to 1.1.1.2
	external/mit/expat/dist/expat.pc.in: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.cmake: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.3
	external/mit/expat/dist/amiga/Makefile: up to 1.1.1.2
	external/mit/expat/dist/amiga/README.txt: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_68k.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k_handler_stubs.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_base.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/stdlib.c: delete
	external/mit/expat/dist/bcb5/elements.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/outline.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.2
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4: up to 1.4
	external/mit/expat/dist/conftools/config.guess: up to 1.1.1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.1.1.3
	external/mit/expat/dist/conftools/expat.m4: up to 1.1.1.2
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/libtool.m4: delete
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/mkinstalldirs: up to 1.4
	external/mit/expat/dist/doc/reference.html: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.sgml: up to 1.1.1.3
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.2
	external/mit/expat/dist/examples/elements.dsp: up to 1.1.1.2
	external/mit/expat/dist/examples/outline.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/amigaconfig.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.3
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpat.def: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpatw.def: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.4
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.h: up to 1.1.1.1
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.3
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.1
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.1
	external/mit/expat/dist/tests/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.2
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.2
	external/mit/expat/dist/tests/xmltest.sh: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/benchmark.dsp: up to 1.1.1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.2
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/unixfilemap.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.2
	external/mit/expat/lib/libexpat/Makefile: up to 1.2
	external/mit/expat/lib/libexpat/expat.pc.in: up to 1.1
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.3
	external/mit/expat/lib/libexpat/shlib_version: up to 1.3
Update expat to 2.1.1.  Apply fixes for CVE-2016-0718.
@
text
@d2 1
d4 1
a4 15

scriptversion=2011-11-20.07; # UTC

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
d6 1
a6 2
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
d8 9
a16 14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d19 1
a19 1
# 'make' implicit rules from creating a file called install from it
d23 2
a24 1
# from scratch.
a25 3
nl='
'
IFS=" ""	$nl"
d30 1
a30 30
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.

chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'
a31 1
posix_mkdir=
d33 1
a33 2
# Desired mode of installed file.
mode=0755
d35 16
a50 4
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
d52 4
a55 38
stripcmd=

src=
dst=
dir_arg=
dst_arg=

copy_on_change=false
no_target_directory=

usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
     --help     display this help and exit.
     --version  display version info and exit.

  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"
d57 1
a57 1
while test $# -ne 0; do
d59 3
a61 1
    -c) ;;
d63 3
a65 1
    -C) copy_on_change=true;;
d67 4
a70 15
    -d) dir_arg=true;;

    -g) chgrpcmd="$chgrpprog $2"
	shift;;

    --help) echo "$usage"; exit $?;;

    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;
d73 3
a75 1
	shift;;
d77 4
a80 1
    -s) stripcmd=$stripprog;;
d82 3
a84 6
    -t) dst_arg=$2
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
	shift;;
d86 3
a88 1
    -T) no_target_directory=true;;
d90 3
a92 1
    --version) echo "$0 $scriptversion"; exit $?;;
d94 8
a101 8
    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;

    *)  break;;
  esac
d103 1
a103 18
done

if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@@ is not empty: it contains at least $arg.
      set fnord "$@@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
a105 1
fi
d107 3
a109 3
if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
d111 2
a112 4
  fi
  # It's OK to call 'install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
d115 7
a121 24
if test -z "$dir_arg"; then
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15

  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
d123 1
a123 4
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
a124 13

for src
do
  # Protect names problematic for 'test' and other utilities.
  case $src in
    -* | [=\(\)!]) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
d127 1
a127 1
    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
d130 6
a135 2
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
d139 3
a141 2
    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
d143 2
a145 1
    dst=$dst_arg
d147 2
a148 37
    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `
d150 5
a154 2
      test -d "$dstdir"
      dstdir_status=$?
d158 2
a159 1
  obsolete_mkdir_used=false
d161 16
a176 26
  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi
d178 3
a180 9
	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
d182 1
a182 2
	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
d184 3
a186 17
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
d188 3
a190 4
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
a191 3
	    trap '' 0;;
	esac;;
    esac
d193 15
a207 37
    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	[-=\(\)!]*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test X"$d" = X && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
d209 2
a210 11
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
d212 8
a220 2
	prefix=$prefix/
      done
d222 1
a222 20
      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_
d224 1
a224 2
    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
d226 7
a232 2
    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
a233 2
    # and set any options; do chmod last to preserve setuid bits.
    #
d236 13
a248 50
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1
a249 3
    trap '' 0
  fi
done
d251 1
a251 7
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


1.1.1.1.2.2
log
@Pull up following revision(s) (requested by spz in ticket #1435):
	external/mit/expat/dist/CMake.README: up to 1.1.1.3
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.3
	external/mit/expat/dist/COPYING: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.4
	external/mit/expat/dist/MANIFEST: up to 1.1.1.4
	external/mit/expat/dist/Makefile.in: up to 1.1.1.4
	external/mit/expat/dist/README: up to 1.1.1.4
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.3
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/xmlwf.mak: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.4
	external/mit/expat/dist/configure.ac: up to 1.1.1.2
	external/mit/expat/dist/conftools/config.guess: up to 1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.4
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.4
	external/mit/expat/dist/doc/expat.png: up to 1.1.1.2
	external/mit/expat/dist/doc/valid-xhtml10.png: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.sgml          delete
	external/mit/expat/dist/doc/xmlwf.xml: up to 1.1.1.1
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.3
	external/mit/expat/dist/examples/outline.c: up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.4
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.4
	external/mit/expat/dist/lib/expat_external.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.6
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.3
	external/mit/expat/dist/lib/xmltok.c: up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.5
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.3
	external/mit/expat/dist/tests/minicheck.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.3
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.3
	external/mit/expat/dist/tests/xmltest.sh: up to 1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.3
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/readfilemap.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.3
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.4
Update expat to 2.2.0, fixing CVE-2016-0718, CVE-2016-4472,
CVE-2016-5300, and CVE-2012-6702.
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d132 1
a132 1
  case $1 in
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d153 2
a154 2
    -o) chowncmd="$chownprog $2"
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
d177 1
a177 1
  shift
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

d197 1
a197 1
  done
d203 1
a203 1
    exit 1
a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 3
a235 3
        u_plus_rw=
      else
        u_plus_rw=,u+rw
d239 1
a239 1
fi
d253 1
a253 1
  else
d256 2
a257 2
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
d260 3
a262 3
      exit 1
    fi

d265 2
a266 2
      exit 1
    fi
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d309 2
a310 2
    fi
  fi
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d464 2
a465 2
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.1.8.1
log
@Pull up following revision(s) (requested by spz in ticket #1383):
	distrib/sets/lists/base/ad.mips64eb: patch
	distrib/sets/lists/base/ad.mips64el: patch
	distrib/sets/lists/base/md.amd64: patch
	distrib/sets/lists/base/md.sparc64: patch
	distrib/sets/lists/base/shl.mi: 1.771, 1.772 via patch
	distrib/sets/lists/comp/ad.mips64eb: patch
	distrib/sets/lists/comp/ad.mips64el: patch
	distrib/sets/lists/comp/md.amd64: patch
	distrib/sets/lists/comp/md.sparc64: patch
	distrib/sets/lists/comp/mi: 1.2035 via patch
	distrib/sets/lists/comp/shl.mi: patch
	external/mit/expat/dist/CMake.README: up to 1.1.1.2
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.3
	external/mit/expat/dist/ConfigureChecks.cmake: up to 1.1.1.1
	external/mit/expat/dist/MANIFEST: up to 1.1.1.3
	external/mit/expat/dist/Makefile.in: up to 1.1.1.3
	external/mit/expat/dist/README: up to 1.1.1.3
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.3
	external/mit/expat/dist/configure.ac: up to 1.1.1.1
	external/mit/expat/dist/configure.in: up to 1.1.1.2
	external/mit/expat/dist/expat.pc.in: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.cmake: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.3
	external/mit/expat/dist/amiga/Makefile: up to 1.1.1.2
	external/mit/expat/dist/amiga/README.txt: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_68k.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k_handler_stubs.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_base.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/stdlib.c: delete
	external/mit/expat/dist/bcb5/elements.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/outline.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.2
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4: up to 1.4
	external/mit/expat/dist/conftools/config.guess: up to 1.1.1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.1.1.3
	external/mit/expat/dist/conftools/expat.m4: up to 1.1.1.2
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/libtool.m4: delete
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/mkinstalldirs: up to 1.4
	external/mit/expat/dist/doc/reference.html: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.sgml: up to 1.1.1.3
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.2
	external/mit/expat/dist/examples/elements.dsp: up to 1.1.1.2
	external/mit/expat/dist/examples/outline.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/amigaconfig.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.3
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpat.def: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpatw.def: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.4
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.h: up to 1.1.1.1
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.3
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.1
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.1
	external/mit/expat/dist/tests/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.2
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.2
	external/mit/expat/dist/tests/xmltest.sh: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/benchmark.dsp: up to 1.1.1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.2
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/unixfilemap.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.2
	external/mit/expat/lib/libexpat/Makefile: up to 1.2
	external/mit/expat/lib/libexpat/expat.pc.in: up to 1.1
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.3
	external/mit/expat/lib/libexpat/shlib_version: up to 1.3
Update expat to 2.1.1.  Apply fixes for CVE-2016-0718.
@
text
@d2 1
d4 1
a4 15

scriptversion=2011-11-20.07; # UTC

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
d6 1
a6 2
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
d8 9
a16 14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d19 1
a19 1
# 'make' implicit rules from creating a file called install from it
d23 2
a24 1
# from scratch.
a25 3
nl='
'
IFS=" ""	$nl"
d30 1
a30 30
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.

chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'
a31 1
posix_mkdir=
d33 1
a33 2
# Desired mode of installed file.
mode=0755
d35 16
a50 4
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
d52 4
a55 38
stripcmd=

src=
dst=
dir_arg=
dst_arg=

copy_on_change=false
no_target_directory=

usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
     --help     display this help and exit.
     --version  display version info and exit.

  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"
d57 1
a57 1
while test $# -ne 0; do
d59 3
a61 1
    -c) ;;
d63 3
a65 1
    -C) copy_on_change=true;;
d67 4
a70 15
    -d) dir_arg=true;;

    -g) chgrpcmd="$chgrpprog $2"
	shift;;

    --help) echo "$usage"; exit $?;;

    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;
d73 3
a75 1
	shift;;
d77 4
a80 1
    -s) stripcmd=$stripprog;;
d82 3
a84 6
    -t) dst_arg=$2
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
	shift;;
d86 3
a88 1
    -T) no_target_directory=true;;
d90 3
a92 1
    --version) echo "$0 $scriptversion"; exit $?;;
d94 8
a101 8
    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;

    *)  break;;
  esac
d103 1
a103 18
done

if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@@ is not empty: it contains at least $arg.
      set fnord "$@@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
a105 1
fi
d107 3
a109 3
if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
d111 2
a112 4
  fi
  # It's OK to call 'install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
d115 7
a121 24
if test -z "$dir_arg"; then
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15

  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
d123 1
a123 4
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
a124 13

for src
do
  # Protect names problematic for 'test' and other utilities.
  case $src in
    -* | [=\(\)!]) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
d127 1
a127 1
    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
d130 6
a135 2
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
d139 3
a141 2
    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
d143 2
a145 1
    dst=$dst_arg
d147 2
a148 37
    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `
d150 5
a154 2
      test -d "$dstdir"
      dstdir_status=$?
d158 2
a159 1
  obsolete_mkdir_used=false
d161 16
a176 26
  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi
d178 3
a180 9
	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
d182 1
a182 2
	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
d184 3
a186 17
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
d188 3
a190 4
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
a191 3
	    trap '' 0;;
	esac;;
    esac
d193 15
a207 37
    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	[-=\(\)!]*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test X"$d" = X && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
d209 2
a210 11
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
d212 8
a220 2
	prefix=$prefix/
      done
d222 1
a222 20
      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_
d224 1
a224 2
    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
d226 7
a232 2
    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
a233 2
    # and set any options; do chmod last to preserve setuid bits.
    #
d236 13
a248 50
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1
a249 3
    trap '' 0
  fi
done
d251 1
a251 7
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


1.1.1.1.8.2
log
@Pull up following revision(s) (requested by spz in ticket #1435):
	external/mit/expat/dist/CMake.README: up to 1.1.1.3
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.3
	external/mit/expat/dist/COPYING: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.4
	external/mit/expat/dist/MANIFEST: up to 1.1.1.4
	external/mit/expat/dist/Makefile.in: up to 1.1.1.4
	external/mit/expat/dist/README: up to 1.1.1.4
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.3
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/xmlwf.mak: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.4
	external/mit/expat/dist/configure.ac: up to 1.1.1.2
	external/mit/expat/dist/conftools/config.guess: up to 1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.4
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.4
	external/mit/expat/dist/doc/expat.png: up to 1.1.1.2
	external/mit/expat/dist/doc/valid-xhtml10.png: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.sgml          delete
	external/mit/expat/dist/doc/xmlwf.xml: up to 1.1.1.1
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.3
	external/mit/expat/dist/examples/outline.c: up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.4
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.4
	external/mit/expat/dist/lib/expat_external.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.6
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.3
	external/mit/expat/dist/lib/xmltok.c: up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.5
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.3
	external/mit/expat/dist/tests/minicheck.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.3
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.3
	external/mit/expat/dist/tests/xmltest.sh: up to 1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.3
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/readfilemap.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.3
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.4
Update expat to 2.2.0, fixing CVE-2016-0718, CVE-2016-4472,
CVE-2016-5300, and CVE-2012-6702.
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d132 1
a132 1
  case $1 in
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d153 2
a154 2
    -o) chowncmd="$chownprog $2"
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
d177 1
a177 1
  shift
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

d197 1
a197 1
  done
d203 1
a203 1
    exit 1
a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 3
a235 3
        u_plus_rw=
      else
        u_plus_rw=,u+rw
d239 1
a239 1
fi
d253 1
a253 1
  else
d256 2
a257 2
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
d260 3
a262 3
      exit 1
    fi

d265 2
a266 2
      exit 1
    fi
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d309 2
a310 2
    fi
  fi
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d464 2
a465 2
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.1.6.1
log
@Pull up following revision(s) (requested by spz in ticket #1383):
	distrib/sets/lists/base/ad.mips64eb: patch
	distrib/sets/lists/base/ad.mips64el: patch
	distrib/sets/lists/base/md.amd64: patch
	distrib/sets/lists/base/md.sparc64: patch
	distrib/sets/lists/base/shl.mi: 1.771, 1.772 via patch
	distrib/sets/lists/comp/ad.mips64eb: patch
	distrib/sets/lists/comp/ad.mips64el: patch
	distrib/sets/lists/comp/md.amd64: patch
	distrib/sets/lists/comp/md.sparc64: patch
	distrib/sets/lists/comp/mi: 1.2035 via patch
	distrib/sets/lists/comp/shl.mi: patch
	external/mit/expat/dist/CMake.README: up to 1.1.1.2
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.3
	external/mit/expat/dist/ConfigureChecks.cmake: up to 1.1.1.1
	external/mit/expat/dist/MANIFEST: up to 1.1.1.3
	external/mit/expat/dist/Makefile.in: up to 1.1.1.3
	external/mit/expat/dist/README: up to 1.1.1.3
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.3
	external/mit/expat/dist/configure.ac: up to 1.1.1.1
	external/mit/expat/dist/configure.in: up to 1.1.1.2
	external/mit/expat/dist/expat.pc.in: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.cmake: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.3
	external/mit/expat/dist/amiga/Makefile: up to 1.1.1.2
	external/mit/expat/dist/amiga/README.txt: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_68k.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_68k_handler_stubs.c: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_base.h: up to 1.1.1.1
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/stdlib.c: delete
	external/mit/expat/dist/bcb5/elements.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/outline.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.2
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4: up to 1.4
	external/mit/expat/dist/conftools/config.guess: up to 1.1.1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.1.1.3
	external/mit/expat/dist/conftools/expat.m4: up to 1.1.1.2
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/libtool.m4: delete
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/mkinstalldirs: up to 1.4
	external/mit/expat/dist/doc/reference.html: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.sgml: up to 1.1.1.3
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.2
	external/mit/expat/dist/examples/elements.dsp: up to 1.1.1.2
	external/mit/expat/dist/examples/outline.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/amigaconfig.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.3
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpat.def: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpatw.def: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.4
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.h: up to 1.1.1.1
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.3
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.1
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.1
	external/mit/expat/dist/tests/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.2
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.2
	external/mit/expat/dist/tests/xmltest.sh: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/README.txt: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/benchmark.dsp: up to 1.1.1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.2
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/unixfilemap.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.2
	external/mit/expat/lib/libexpat/Makefile: up to 1.2
	external/mit/expat/lib/libexpat/expat.pc.in: up to 1.1
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.3
	external/mit/expat/lib/libexpat/shlib_version: up to 1.3
Update expat to 2.1.1.  Apply fixes for CVE-2016-0718.
@
text
@d2 1
d4 1
a4 15

scriptversion=2011-11-20.07; # UTC

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
d6 1
a6 2
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
d8 9
a16 14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
d19 1
a19 1
# 'make' implicit rules from creating a file called install from it
d23 2
a24 1
# from scratch.
a25 3
nl='
'
IFS=" ""	$nl"
d30 1
a30 30
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.

chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'
a31 1
posix_mkdir=
d33 1
a33 2
# Desired mode of installed file.
mode=0755
d35 16
a50 4
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
d52 4
a55 38
stripcmd=

src=
dst=
dir_arg=
dst_arg=

copy_on_change=false
no_target_directory=

usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
     --help     display this help and exit.
     --version  display version info and exit.

  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"
d57 1
a57 1
while test $# -ne 0; do
d59 3
a61 1
    -c) ;;
d63 3
a65 1
    -C) copy_on_change=true;;
d67 4
a70 15
    -d) dir_arg=true;;

    -g) chgrpcmd="$chgrpprog $2"
	shift;;

    --help) echo "$usage"; exit $?;;

    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;
d73 3
a75 1
	shift;;
d77 4
a80 1
    -s) stripcmd=$stripprog;;
d82 3
a84 6
    -t) dst_arg=$2
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
	shift;;
d86 3
a88 1
    -T) no_target_directory=true;;
d90 3
a92 1
    --version) echo "$0 $scriptversion"; exit $?;;
d94 8
a101 8
    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;

    *)  break;;
  esac
d103 1
a103 18
done

if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@@ is not empty: it contains at least $arg.
      set fnord "$@@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
a105 1
fi
d107 3
a109 3
if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
d111 2
a112 4
  fi
  # It's OK to call 'install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
d115 7
a121 24
if test -z "$dir_arg"; then
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15

  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
d123 1
a123 4
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
a124 13

for src
do
  # Protect names problematic for 'test' and other utilities.
  case $src in
    -* | [=\(\)!]) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
d127 1
a127 1
    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
d130 6
a135 2
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
d139 3
a141 2
    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
d143 2
a145 1
    dst=$dst_arg
d147 2
a148 37
    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `
d150 5
a154 2
      test -d "$dstdir"
      dstdir_status=$?
d158 2
a159 1
  obsolete_mkdir_used=false
d161 16
a176 26
  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi
d178 3
a180 9
	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
d182 1
a182 2
	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
d184 3
a186 17
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
d188 3
a190 4
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
a191 3
	    trap '' 0;;
	esac;;
    esac
d193 15
a207 37
    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	[-=\(\)!]*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test X"$d" = X && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
d209 2
a210 11
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
d212 8
a220 2
	prefix=$prefix/
      done
d222 1
a222 20
      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_
d224 1
a224 2
    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
d226 7
a232 2
    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
a233 2
    # and set any options; do chmod last to preserve setuid bits.
    #
d236 13
a248 50
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1
a249 3
    trap '' 0
  fi
done
d251 1
a251 7
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


1.1.1.1.6.2
log
@Pull up following revision(s) (requested by spz in ticket #1435):
	external/mit/expat/dist/CMake.README: up to 1.1.1.3
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.3
	external/mit/expat/dist/COPYING: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.4
	external/mit/expat/dist/MANIFEST: up to 1.1.1.4
	external/mit/expat/dist/Makefile.in: up to 1.1.1.4
	external/mit/expat/dist/README: up to 1.1.1.4
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.3
	external/mit/expat/dist/amiga/expat_lib.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/expat_vectors.c: up to 1.1.1.2
	external/mit/expat/dist/amiga/launch.c: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/xmlwf.mak: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.4
	external/mit/expat/dist/configure.ac: up to 1.1.1.2
	external/mit/expat/dist/conftools/config.guess: up to 1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.4
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.4
	external/mit/expat/dist/doc/expat.png: up to 1.1.1.2
	external/mit/expat/dist/doc/valid-xhtml10.png: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.sgml          delete
	external/mit/expat/dist/doc/xmlwf.xml: up to 1.1.1.1
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.3
	external/mit/expat/dist/examples/outline.c: up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.4
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.4
	external/mit/expat/dist/lib/expat_external.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.6
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.3
	external/mit/expat/dist/lib/xmltok.c: up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.5
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.3
	external/mit/expat/dist/tests/minicheck.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.3
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.3
	external/mit/expat/dist/tests/xmltest.sh: up to 1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.3
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/readfilemap.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.3
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.4
Update expat to 2.2.0, fixing CVE-2016-0718, CVE-2016-4472,
CVE-2016-5300, and CVE-2012-6702.
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d132 1
a132 1
  case $1 in
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d153 2
a154 2
    -o) chowncmd="$chownprog $2"
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
d177 1
a177 1
  shift
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

d197 1
a197 1
  done
d203 1
a203 1
    exit 1
a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 3
a235 3
        u_plus_rw=
      else
        u_plus_rw=,u+rw
d239 1
a239 1
fi
d253 1
a253 1
  else
d256 2
a257 2
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
d260 3
a262 3
      exit 1
    fi

d265 2
a266 2
      exit 1
    fi
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d309 2
a310 2
    fi
  fi
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d464 2
a465 2
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.2
log
@import of expat 2.1.0
Fixes CVE-2012-1147, CVE-2012-1148 and CVE-2012-0876 (other security
issues have been previously fixed in our tree)

relevant Changes:
Release 2.1.0 Sat March 24 2012
        - Bug Fixes:
          #1742315: Harmful XML_ParserCreateNS suggestion.
          #2895533: CVE-2012-1147 - Resource leak in readfilemap.c.
          #1785430: Expat build fails on linux-amd64 with gcc version>=4.1 -O3.
          #1983953, 2517952, 2517962, 2649838:
                Build modifications using autoreconf instead of buildconf.sh.
          #2815947, #2884086: OBJEXT and EXEEXT support while building.
          #1990430: CVE-2009-3720 - Parser crash with special UTF-8 sequences.
          #2517938: xmlwf should return non-zero exit status if not well-formed.
          #2517946: Wrong statement about XMLDecl in xmlwf.1 and xmlwf.sgml.
          #2855609: Dangling positionPtr after error.
          #2894085: CVE-2009-3560 - Buffer over-read and crash in big2_toUtf8().
          #2958794: CVE-2012-1148 - Memory leak in poolGrow.
          #2990652: CMake support.
          #3010819: UNEXPECTED_STATE with a trailing "%" in entity value.
          #3206497: Unitialized memory returned from XML_Parse.
          #3287849: make check fails on mingw-w64.
          #3496608: CVE-2012-0876 - Hash DOS attack.
        - Patches:
          #1749198: pkg-config support.
          #3010222: Fix for bug #3010819.
          #3312568: CMake support.
          #3446384: Report byte offsets for attr names and values.
        - New Features / API changes:
          Added new API member XML_SetHashSalt() that allows setting an intial
                value (salt) for hash calculations. This is part of the fix for
                bug #3496608 to randomize hash parameters.
          When compiled with XML_ATTR_INFO defined, adds new API member
                XML_GetAttributeInfo() that allows retrieving the byte
                offsets for attribute names and values (patch #3446384).
          Added CMake build system.
                See bug #2990652 and patch #3312568.
          Added run-benchmark target to Makefile.in - relies on testdata module
                present in the same relative location as in the repository.
@
text
@d2 1
d4 1
a4 30

scriptversion=2009-04-28.21; # UTC

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
d6 1
d8 9
a16 1
# FSF changes to this file are in the public domain.
d23 2
a24 1
# from scratch.
a25 3
nl='
'
IFS=" ""	$nl"
d30 1
a30 9
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.
a31 22
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'

posix_mkdir=
d33 1
a33 2
# Desired mode of installed file.
mode=0755
d35 16
a50 4
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
d52 41
a92 1
stripcmd=
d94 12
a105 4
src=
dst=
dir_arg=
dst_arg=
d107 7
a113 2
copy_on_change=false
no_target_directory=
d115 11
a125 5
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...
d127 19
a145 3
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
d147 2
a148 3
Options:
     --help     display this help and exit.
     --version  display version info and exit.
d150 7
a156 9
  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.
d158 2
a159 4
Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"
d161 2
a162 3
while test $# -ne 0; do
  case $1 in
    -c) ;;
d164 5
a168 1
    -C) copy_on_change=true;;
d170 18
a187 1
    -d) dir_arg=true;;
d189 3
a191 2
    -g) chgrpcmd="$chgrpprog $2"
	shift;;
d193 9
a201 1
    --help) echo "$usage"; exit $?;;
d203 1
a203 8
    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;
d205 7
a211 2
    -o) chowncmd="$chownprog $2"
	shift;;
d213 1
a213 1
    -s) stripcmd=$stripprog;;
d215 6
a220 12
    -t) dst_arg=$2
	shift;;

    -T) no_target_directory=true;;

    --version) echo "$0 $scriptversion"; exit $?;;

    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;
d222 1
a222 4
    *)  break;;
  esac
  shift
done
d224 1
a224 15
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@@ is not empty: it contains at least $arg.
      set fnord "$@@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
  done
fi
d226 1
a226 9
if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
    exit 1
  fi
  # It's OK to call `install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
fi
d228 1
a228 2
if test -z "$dir_arg"; then
  trap '(exit $?); exit' 1 2 13 15
d230 1
a230 23
  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
fi
d232 1
a232 32
for src
do
  # Protect names starting with `-'.
  case $src in
    -*) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
  else

    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
      exit 1
    fi

    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
      exit 1
    fi

    dst=$dst_arg
    # Protect names starting with `-'.
    case $dst in
      -*) dst=./$dst;;
    esac
d234 3
a236 71
    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `

      test -d "$dstdir"
      dstdir_status=$?
    fi
  fi

  obsolete_mkdir_used=false

  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi
d238 4
a241 9
	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
d243 1
a243 29
	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
	    then
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writeable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
	      fi
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
	    fi
	    trap '' 0;;
	esac;;
    esac
d245 2
a246 53
    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	-*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test -z "$d" && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
	else
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
	  fi
	fi
	prefix=$prefix/
      done
d248 1
a248 81
      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_

    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0

    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&

    # and set any options; do chmod last to preserve setuid bits.
    #
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1
a249 3
    trap '' 0
  fi
done
d251 1
a251 7
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


1.1.1.2.14.1
log
@Pull up following revision(s) (requested by spz in ticket #1169):
	distrib/sets/lists/base/ad.aarch64: patch
	distrib/sets/lists/base/ad.arm: patch
	distrib/sets/lists/base/ad.mips: patch
	distrib/sets/lists/base/ad.powerpc: patch
	distrib/sets/lists/base/md.amd64: patch
	distrib/sets/lists/base/md.sparc64: patch
	distrib/sets/lists/base/shl.mi: 1.771, 1.772 via patch
	distrib/sets/lists/comp/mi: 1.2035
	distrib/sets/lists/debug/ad.aarch64: patch
	distrib/sets/lists/debug/ad.arm: patch
	distrib/sets/lists/debug/ad.mips: patch
	distrib/sets/lists/debug/ad.powerpc: patch
	distrib/sets/lists/debug/md.amd64: patch
	distrib/sets/lists/debug/md.sparc64: patch
	distrib/sets/lists/debug/shl.mi: 1.133, 1.134 via patch
	doc/3RDPARTY: 1.1316, 1.1330
	external/mit/expat/dist/CMake.README: up to 1.1.1.2
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.3
	external/mit/expat/dist/MANIFEST: up to 1.1.1.3
	external/mit/expat/dist/Makefile.in: up to 1.1.1.3
	external/mit/expat/dist/README: up to 1.1.1.3
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.3
	external/mit/expat/dist/configure.ac: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.3
	external/mit/expat/dist/bcb5/elements.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/outline.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.2
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4: up to 1.4
	external/mit/expat/dist/conftools/config.guess: up to 1.1.1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.1.1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/mkinstalldirs: up to 1.4
	external/mit/expat/dist/doc/reference.html: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.sgml: up to 1.1.1.3
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.2
	external/mit/expat/dist/lib/amigaconfig.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.3
	external/mit/expat/dist/lib/libexpat.def: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpatw.def: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.4
	external/mit/expat/dist/lib/xmltok.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.h: up to 1.1.1.1
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.3
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/README.txt: up to 1.1.1.2
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/unixfilemap.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.3
	external/mit/expat/lib/libexpat/Makefile: up to 1.2
	external/mit/expat/lib/libexpat/expat.pc.in: up to 1.1
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.3
	external/mit/expat/lib/libexpat/shlib_version: up to 1.3
Update expat to 2.1.1.  Apply fixes for CVE-2016-0718.
@
text
@d4 1
a4 1
scriptversion=2011-11-20.07; # UTC
d38 1
a38 1
# 'make' implicit rules from creating a file called install from it
a158 4
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
a188 4
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
    esac
d197 1
a197 1
  # It's OK to call 'install-sh -d' without argument.
d203 1
a203 5
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15
d231 1
a231 1
  # Protect names problematic for 'test' and other utilities.
d233 1
a233 1
    -* | [=\(\)!]) src=./$src;;
d255 1
d257 4
d350 1
a350 1
		   # other-writable bit of parent directory when it shouldn't.
d388 1
a388 1
	[-=\(\)!]*) prefix='./';;
d406 1
a406 1
	test X"$d" = X && continue
@


1.1.1.2.14.2
log
@Pull up following revision(s) (requested by spz in ticket #1361):
	doc/3RDPARTY: 1.398, 1.1407
	external/mit/expat/dist/CMake.README: up to 1.1.1.3
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.3
	external/mit/expat/dist/COPYING: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.4
	external/mit/expat/dist/MANIFEST: up to 1.1.1.4
	external/mit/expat/dist/Makefile.in: up to 1.1.1.4
	external/mit/expat/dist/README: up to 1.1.1.4
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/xmlwf.mak: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.4
	external/mit/expat/dist/configure.ac: up to 1.1.1.2
	external/mit/expat/dist/conftools/config.guess: up to 1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.4
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.4
	external/mit/expat/dist/doc/expat.png: up to 1.1.1.2
	external/mit/expat/dist/doc/valid-xhtml10.png: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.sgml          delete
	external/mit/expat/dist/doc/xmlwf.xml: up to 1.1.1.1
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.3
	external/mit/expat/dist/examples/outline.c: up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.4
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.4
	external/mit/expat/dist/lib/expat_external.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.6
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.3
	external/mit/expat/dist/lib/xmltok.c: up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.5
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.3
	external/mit/expat/dist/tests/minicheck.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.3
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.3
	external/mit/expat/dist/tests/xmltest.sh: up to 1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.3
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/readfilemap.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.3
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.4
Update expat to 2.2.0, fixing CVE-2016-0718, CVE-2016-4472, CVE-2016-5300,
and CVE-2012-6702.
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.2.12.1
log
@Pull up following revision(s) (requested by spz in ticket #1169):
	distrib/sets/lists/base/ad.aarch64: patch
	distrib/sets/lists/base/ad.arm: patch
	distrib/sets/lists/base/ad.mips: patch
	distrib/sets/lists/base/ad.powerpc: patch
	distrib/sets/lists/base/md.amd64: patch
	distrib/sets/lists/base/md.sparc64: patch
	distrib/sets/lists/base/shl.mi: 1.771, 1.772 via patch
	distrib/sets/lists/comp/mi: 1.2035
	distrib/sets/lists/debug/ad.aarch64: patch
	distrib/sets/lists/debug/ad.arm: patch
	distrib/sets/lists/debug/ad.mips: patch
	distrib/sets/lists/debug/ad.powerpc: patch
	distrib/sets/lists/debug/md.amd64: patch
	distrib/sets/lists/debug/md.sparc64: patch
	distrib/sets/lists/debug/shl.mi: 1.133, 1.134 via patch
	doc/3RDPARTY: 1.1316, 1.1330
	external/mit/expat/dist/CMake.README: up to 1.1.1.2
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.3
	external/mit/expat/dist/MANIFEST: up to 1.1.1.3
	external/mit/expat/dist/Makefile.in: up to 1.1.1.3
	external/mit/expat/dist/README: up to 1.1.1.3
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.3
	external/mit/expat/dist/configure.ac: up to 1.1.1.1
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.3
	external/mit/expat/dist/bcb5/elements.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/outline.bpr: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.2
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4: up to 1.4
	external/mit/expat/dist/conftools/config.guess: up to 1.1.1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.1.1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.3
	external/mit/expat/dist/conftools/mkinstalldirs: up to 1.4
	external/mit/expat/dist/doc/reference.html: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.sgml: up to 1.1.1.3
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.2
	external/mit/expat/dist/lib/amigaconfig.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.3
	external/mit/expat/dist/lib/libexpat.def: up to 1.1.1.2
	external/mit/expat/dist/lib/libexpatw.def: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.4
	external/mit/expat/dist/lib/xmltok.c: up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.h: up to 1.1.1.1
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.3
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.2
	external/mit/expat/dist/tests/benchmark/README.txt: up to 1.1.1.2
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/unixfilemap.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.3
	external/mit/expat/lib/libexpat/Makefile: up to 1.2
	external/mit/expat/lib/libexpat/expat.pc.in: up to 1.1
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.3
	external/mit/expat/lib/libexpat/shlib_version: up to 1.3
Update expat to 2.1.1.  Apply fixes for CVE-2016-0718.
@
text
@d4 1
a4 1
scriptversion=2011-11-20.07; # UTC
d38 1
a38 1
# 'make' implicit rules from creating a file called install from it
a158 4
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
a188 4
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
    esac
d197 1
a197 1
  # It's OK to call 'install-sh -d' without argument.
d203 1
a203 5
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15
d231 1
a231 1
  # Protect names problematic for 'test' and other utilities.
d233 1
a233 1
    -* | [=\(\)!]) src=./$src;;
d255 1
d257 4
d350 1
a350 1
		   # other-writable bit of parent directory when it shouldn't.
d388 1
a388 1
	[-=\(\)!]*) prefix='./';;
d406 1
a406 1
	test X"$d" = X && continue
@


1.1.1.2.12.1.2.1
log
@Sync with netbsd-7-1-RELEASE
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.2.12.2
log
@Pull up following revision(s) (requested by spz in ticket #1361):
	doc/3RDPARTY: 1.398, 1.1407
	external/mit/expat/dist/CMake.README: up to 1.1.1.3
	external/mit/expat/dist/CMakeLists.txt: up to 1.1.1.3
	external/mit/expat/dist/COPYING: up to 1.1.1.2
	external/mit/expat/dist/Changes: up to 1.1.1.4
	external/mit/expat/dist/MANIFEST: up to 1.1.1.4
	external/mit/expat/dist/Makefile.in: up to 1.1.1.4
	external/mit/expat/dist/README: up to 1.1.1.4
	external/mit/expat/dist/aclocal.m4: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expat_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expat_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/expatw_static.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/expatw_static.mak: up to 1.1.1.2
	external/mit/expat/dist/bcb5/xmlwf.bpr: up to 1.1.1.3
	external/mit/expat/dist/bcb5/xmlwf.mak: up to 1.1.1.2
	external/mit/expat/dist/configure: up to 1.1.1.4
	external/mit/expat/dist/configure.ac: up to 1.1.1.2
	external/mit/expat/dist/conftools/config.guess: up to 1.3
	external/mit/expat/dist/conftools/config.sub: up to 1.3
	external/mit/expat/dist/conftools/install-sh: up to 1.1.1.4
	external/mit/expat/dist/conftools/ltmain.sh: up to 1.1.1.4
	external/mit/expat/dist/doc/expat.png: up to 1.1.1.2
	external/mit/expat/dist/doc/valid-xhtml10.png: up to 1.1.1.2
	external/mit/expat/dist/doc/xmlwf.1: up to 1.1.1.3
	external/mit/expat/dist/doc/xmlwf.sgml          delete
	external/mit/expat/dist/doc/xmlwf.xml: up to 1.1.1.1
	external/mit/expat/dist/examples/elements.c: up to 1.1.1.3
	external/mit/expat/dist/examples/outline.c: up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in: up to 1.1.1.4
	external/mit/expat/dist/lib/expat.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expat.h: up to 1.1.1.4
	external/mit/expat/dist/lib/expat_external.h: up to 1.1.1.2
	external/mit/expat/dist/lib/expat_static.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw.dsp: up to 1.1.1.3
	external/mit/expat/dist/lib/expatw_static.dsp: up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h: up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c: up to 1.6
	external/mit/expat/dist/lib/xmlrole.c: up to 1.1.1.3
	external/mit/expat/dist/lib/xmltok.c: up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c: up to 1.5
	external/mit/expat/dist/m4/libtool.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltoptions.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/ltsugar.m4: up to 1.1.1.2
	external/mit/expat/dist/m4/ltversion.m4: up to 1.1.1.3
	external/mit/expat/dist/m4/lt~obsolete.m4: up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c: up to 1.1.1.3
	external/mit/expat/dist/tests/minicheck.c: up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.h: up to 1.1.1.3
	external/mit/expat/dist/tests/runtests.c: up to 1.1.1.3
	external/mit/expat/dist/tests/xmltest.sh: up to 1.2
	external/mit/expat/dist/win32/README.txt: up to 1.1.1.3
	external/mit/expat/dist/win32/expat.iss: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/readfilemap.c: up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c: up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c: up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlwf.dsp: up to 1.1.1.3
	external/mit/expat/lib/libexpat/expat_config.h: up to 1.4
Update expat to 2.2.0, fixing CVE-2016-0718, CVE-2016-4472, CVE-2016-5300,
and CVE-2012-6702.
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.3
log
@Import of a new expat version. Upstream Changes:

Release 2.1.1 Sat March 12 2016
        Security fixes:
            #582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer

        Bug fixes:
            #502: Fix potential null pointer dereference
            #520: Symbol XML_SetHashSalt was not exported
            Output of "xmlwf -h" was incomplete

        Other changes
            #503: Document behavior of calling XML_SetHashSalt with salt 0
            Minor improvements to man page xmlwf(1)
            Improvements to the experimental CMake build system
            libtool now invoked with --verbose
@
text
@d4 1
a4 1
scriptversion=2011-11-20.07; # UTC
d38 1
a38 1
# 'make' implicit rules from creating a file called install from it
a158 4
	# Protect names problematic for 'test' and other utilities.
	case $dst_arg in
	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
	esac
a188 4
    # Protect names problematic for 'test' and other utilities.
    case $dst_arg in
      -* | [=\(\)!]) dst_arg=./$dst_arg;;
    esac
d197 1
a197 1
  # It's OK to call 'install-sh -d' without argument.
d203 1
a203 5
  do_exit='(exit $ret); exit $ret'
  trap "ret=129; $do_exit" 1
  trap "ret=130; $do_exit" 2
  trap "ret=141; $do_exit" 13
  trap "ret=143; $do_exit" 15
d231 1
a231 1
  # Protect names problematic for 'test' and other utilities.
d233 1
a233 1
    -* | [=\(\)!]) src=./$src;;
d255 1
d257 4
d350 1
a350 1
		   # other-writable bit of parent directory when it shouldn't.
d388 1
a388 1
	[-=\(\)!]*) prefix='./';;
d406 1
a406 1
	test X"$d" = X && continue
@


1.1.1.3.4.1
log
@Sync with HEAD
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.3.2.1
log
@Sync with HEAD
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.4
log
@from Changes:
    Release 2.2.0 Tue June 21 2016
        Security fixes:
            #537  CVE-2016-0718 -- Fix crash on malformed input
                  CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
                                   CVE-2015-2716 introduced with Expat 2.1.1
            #499  CVE-2016-5300 -- Use more entropy for hash initialization
                                   than the original fix to CVE-2012-0876
            #519  CVE-2012-6702 -- Resolve troublesome internal call to srand
                                   that was introduced with Expat 2.1.0
                                   when addressing CVE-2012-0876 (issue #496)

        Bug fixes:
                  Fix uninitialized reads of size 1
                    (e.g. in little2_updatePosition)
                  Fix detection of UTF-8 character boundaries

        Other changes:
            #532  Fix compilation for Visual Studio 2010 (keyword "C99")
                  Autotools: Resolve use of "$<" to better support bmake
                  Autotools: Add QA script "qa.sh" (and make target "qa")
                  Autotools: Respect CXXFLAGS if given
                  Autotools: Fix "make run-xmltest"
                  Autotools: Have "make run-xmltest" check for expected output
             p90  CMake: Fix static build (BUILD_shared=OFF) on Windows
            #536  CMake: Add soversion, support -DNO_SONAME=yes to bypass
            #323  CMake: Add suffix "d" to differentiate debug from release
                  CMake: Define WIN32 with CMake on Windows
                  Annotate memory allocators for GCC
                  Address all currently known compile warnings
                  Make sure that API symbols remain visible despite
                    -fvisibility=hidden
                  Remove executable flag from source files
                  Resolve COMPILED_FROM_DSP in favor of WIN32
@
text
@d4 1
a4 1
scriptversion=2013-12-25.23; # UTC
a43 1
tab='	'
d46 1
a46 1
IFS=" $tab$nl"
d48 1
a48 1
# Set DOITPROG to "echo" to test this script.
d50 1
d52 5
a56 1
doit_exec=${doit:-exec}
d71 11
d100 1
a100 1
is_target_a_directory=possibly
d140 1
a140 1
        shift;;
d145 7
a151 6
        case $mode in
          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
            echo "$0: invalid mode: $mode" >&2
            exit 1;;
        esac
        shift;;
d154 1
a154 1
        shift;;
d158 6
a163 8
    -t)
        is_target_a_directory=always
        dst_arg=$2
        # Protect names problematic for 'test' and other utilities.
        case $dst_arg in
          -* | [=\(\)!]) dst_arg=./$dst_arg;;
        esac
        shift;;
d165 1
a165 1
    -T) is_target_a_directory=never;;
d169 2
a170 2
    --) shift
        break;;
d172 2
a173 2
    -*) echo "$0: invalid option: $1" >&2
        exit 1;;
a179 10
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.

if test -n "$dir_arg"; then
  if test -n "$dst_arg"; then
    echo "$0: target directory not allowed when installing a directory." >&2
    exit 1
  fi
fi

a210 9
  if test $# -gt 1 || test "$is_target_a_directory" = always; then
    if test ! -d "$dst_arg"; then
      echo "$0: $dst_arg: Is not a directory." >&2
      exit 1
    fi
  fi
fi

if test -z "$dir_arg"; then
d226 1
a226 1
        u_plus_rw=
d228 1
a228 1
        u_plus_rw='% 200'
d233 1
a233 1
        u_plus_rw=
d235 1
a235 1
        u_plus_rw=,u+rw
d272 3
a274 3
      if test "$is_target_a_directory" = never; then
        echo "$0: $dst_arg: Is a directory" >&2
        exit 1
d280 27
a306 1
      dstdir=`dirname "$dst"`
d317 62
a378 62
        # Create intermediate dirs using mode 755 as modified by the umask.
        # This is like FreeBSD 'install' as of 1997-10-28.
        umask=`umask`
        case $stripcmd.$umask in
          # Optimize common cases.
          *[2367][2367]) mkdir_umask=$umask;;
          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

          *[0-7])
            mkdir_umask=`expr $umask + 22 \
              - $umask % 100 % 40 + $umask % 20 \
              - $umask % 10 % 4 + $umask % 2
            `;;
          *) mkdir_umask=$umask,go-w;;
        esac

        # With -d, create the new directory with the user-specified mode.
        # Otherwise, rely on $mkdir_umask.
        if test -n "$dir_arg"; then
          mkdir_mode=-m$mode
        else
          mkdir_mode=
        fi

        posix_mkdir=false
        case $umask in
          *[123567][0-7][0-7])
            # POSIX mkdir -p sets u+wx bits regardless of umask, which
            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
            ;;
          *)
            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

            if (umask $mkdir_umask &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
            then
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                   # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
                     d????-?r-*) different_mode=700;;
                     d????-?--*) different_mode=755;;
                     *) false;;
                   esac &&
                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                   }
                 }
              then posix_mkdir=:
              fi
              rmdir "$tmpdir/d" "$tmpdir"
            else
              # Remove any dirs left behind by ancient mkdir implementations.
              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
            fi
            trap '' 0;;
        esac;;
d383 2
a384 2
        umask $mkdir_umask &&
        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
d394 3
a396 3
        /*) prefix='/';;
        [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
d399 2
d403 1
a403 1
      set -f
d406 1
a406 1
      set +f
d413 1
a413 1
        test X"$d" = X && continue
d415 18
a432 18
        prefix=$prefix$d
        if test -d "$prefix"; then
          prefixes=
        else
          if $posix_mkdir; then
            (umask=$mkdir_umask &&
             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
            # Don't fail if two instances are running concurrently.
            test -d "$prefix" || exit 1
          else
            case $prefix in
              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
              *) qprefix=$prefix;;
            esac
            prefixes="$prefixes '$qprefix'"
          fi
        fi
        prefix=$prefix/
d436 5
a440 5
        # Don't fail if two instances are running concurrently.
        (umask $mkdir_umask &&
         eval "\$doit_exec \$mkdirprog $prefixes") ||
          test -d "$dstdir" || exit 1
        obsolete_mkdir_used=true
d475 5
a479 3
       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
       set -f &&
d482 2
a483 1
       set +f &&
d496 15
a510 15
        # Now remove or move aside any old file at destination location.
        # We try this two ways since rm can't unlink itself on some
        # systems and the destination file might be busy for other
        # reasons.  In this case, the final cleanup might fail but the new
        # file should still install successfully.
        {
          test ! -f "$dst" ||
          $doit $rmcmd -f "$dst" 2>/dev/null ||
          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          } ||
          { echo "$0: cannot unlink or rename $dst" >&2
            (exit 1); exit 1
          }
        } &&
d512 2
a513 2
        # Now rename the file to the real destination.
        $doit $mvcmd "$dsttmp" "$dst"
@


1.1.1.4.12.1
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d4 1
a4 1
scriptversion=2016-01-11.22; # UTC
a326 2
            # $RANDOM is not portable (e.g. dash);  use it when possible to
            # lower collision chance
d328 1
a328 1
            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
a329 3
            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
            # create the $tmpdir first (and fail if unsuccessful) to make sure
            # that nobody tries to guess the $tmpdir name.
d331 1
a331 2
                $mkdirprog $mkdir_mode "$tmpdir" &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
d338 1
a338 2
                   test_tmpdir="$tmpdir/a"
                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
d344 2
a345 2
                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
d351 1
a351 1
              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
d354 1
a354 1
              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
d499 1
a499 1
# time-stamp-time-zone: "UTC0"
@


1.1.1.4.14.1
log
@Sync to current and pull up the following revisions, requested by maya
in ticket #206:

	external/mit/expat/dist/conftools/test-driver   up to 1.1.1.1
	external/mit/expat/dist/conftools/ar-lib        up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-compile-flags.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-link-flags.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-check-compile-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-check-link-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-require-defined.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/compile       up to 1.1.1.1
	external/mit/expat/dist/conftools/depcomp       up to 1.1.1.1
	external/mit/expat/dist/conftools/missing       up to 1.1.1.1
	external/mit/expat/dist/conftools/expatcfg-compiler-supports-visibility.m4 up to 1.1.1.1
	external/mit/expat/dist/doc/Makefile.am         up to 1.1.1.1
	external/mit/expat/dist/doc/Makefile.in         up to 1.1.1.1
	external/mit/expat/dist/examples/Makefile.am    up to 1.1.1.1
	external/mit/expat/dist/examples/Makefile.in    up to 1.1.1.1
	external/mit/expat/dist/lib/Makefile.am         up to 1.1.1.1
	external/mit/expat/dist/lib/Makefile.in         up to 1.1.1.1
	external/mit/expat/dist/tests/benchmark/Makefile.am up to 1.1.1.1
	external/mit/expat/dist/tests/benchmark/Makefile.in up to 1.1.1.1
	external/mit/expat/dist/tests/Makefile.am       up to 1.1.1.1
	external/mit/expat/dist/tests/Makefile.in       up to 1.1.1.1
	external/mit/expat/dist/tests/structdata.c      up to 1.1.1.1
	external/mit/expat/dist/tests/structdata.h      up to 1.1.1.1
	external/mit/expat/dist/tests/udiffer.py        up to 1.1.1.1
	external/mit/expat/dist/tests/xmltest.log.expected up to 1.1.1.1
	external/mit/expat/dist/win32/build_expat_iss.bat up to 1.1.1.1
	external/mit/expat/dist/xmlwf/Makefile.am       up to 1.1.1.1
	external/mit/expat/dist/xmlwf/Makefile.in       up to 1.1.1.1
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.py  up to 1.1.1.1
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.sh  up to 1.1.1.1
	external/mit/expat/dist/Makefile.am             up to 1.1.1.1
	external/mit/expat/dist/README.md               up to 1.1.1.1
	external/mit/expat/dist/cmake/expat-config.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/mingw-toolchain.cmake up to 1.1.1.1
	external/mit/expat/dist/acinclude.m4            up to 1.1.1.1
	external/mit/expat/dist/fix-xmltest-log.sh      up to 1.1.1.1
	external/mit/expat/dist/test-driver-wrapper.sh  up to 1.1.1.1
	external/mit/expat/dist/MANIFEST                delete
	external/mit/expat/dist/README                  delete
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4 delete
	external/mit/expat/dist/conftools/mkinstalldirs delete
	external/mit/expat/dist/xmlwf/xmlurl.h          delete
	external/mit/expat/dist/xmlwf/xmlwin32url.cxx   delete
	external/mit/expat/dist/CMake.README            up to 1.1.1.5
	external/mit/expat/dist/CMakeLists.txt          up to 1.1.1.5
	external/mit/expat/dist/Changes                 up to 1.1.1.6
	external/mit/expat/dist/ConfigureChecks.cmake   up to 1.1.1.2
	external/mit/expat/dist/Makefile.in             up to 1.1.1.6
	external/mit/expat/dist/aclocal.m4              up to 1.1.1.4
	external/mit/expat/dist/configure               up to 1.1.1.6
	external/mit/expat/dist/configure.ac            up to 1.1.1.4
	external/mit/expat/dist/expat_config.h.cmake    up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in       up to 1.1.1.6
	external/mit/expat/dist/conftools/config.guess  up to 1.4
	external/mit/expat/dist/conftools/config.sub    up to 1.4
	external/mit/expat/dist/conftools/get-version.sh up to 1.1.1.2
	external/mit/expat/dist/conftools/install-sh    up to 1.1.1.5
	external/mit/expat/dist/conftools/ltmain.sh     up to 1.1.1.5
	external/mit/expat/dist/doc/reference.html      up to 1.1.1.5
	external/mit/expat/dist/doc/xmlwf.1             up to 1.1.1.4
	external/mit/expat/dist/doc/xmlwf.xml           up to 1.1.1.2
	external/mit/expat/dist/examples/elements.c     up to 1.1.1.5
	external/mit/expat/dist/examples/outline.c      up to 1.1.1.4
	external/mit/expat/dist/lib/ascii.h             up to 1.1.1.2
	external/mit/expat/dist/lib/asciitab.h          up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h             up to 1.1.1.6
	external/mit/expat/dist/lib/expat_external.h    up to 1.1.1.4
	external/mit/expat/dist/lib/iasciitab.h         up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h          up to 1.1.1.3
	external/mit/expat/dist/lib/latin1tab.h         up to 1.1.1.2
	external/mit/expat/dist/lib/libexpat.def        up to 1.1.1.3
	external/mit/expat/dist/lib/libexpatw.def       up to 1.1.1.3
	external/mit/expat/dist/lib/nametab.h           up to 1.1.1.2
	external/mit/expat/dist/lib/siphash.h           up to 1.1.1.2
	external/mit/expat/dist/lib/utf8tab.h           up to 1.1.1.2
	external/mit/expat/dist/lib/winconfig.h         up to 1.1.1.3
	external/mit/expat/dist/lib/xmlparse.c          up to 1.8
	external/mit/expat/dist/lib/xmlrole.c           up to 1.1.1.5
	external/mit/expat/dist/lib/xmlrole.h           up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.c            up to 1.5
	external/mit/expat/dist/lib/xmltok.h            up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c       up to 1.6
	external/mit/expat/dist/lib/xmltok_impl.h       up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok_ns.c         up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c        up to 1.1.1.4
	external/mit/expat/dist/tests/chardata.h        up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.c        up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.h        up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.c       up to 1.1.1.4
	external/mit/expat/dist/tests/minicheck.h       up to 1.1.1.5
	external/mit/expat/dist/tests/runtests.c        up to 1.1.1.5
	external/mit/expat/dist/tests/runtestspp.cpp    up to 1.1.1.2
	external/mit/expat/dist/tests/xmltest.sh        up to 1.4
	external/mit/expat/dist/tests/benchmark/benchmark.c up to 1.1.1.3
	external/mit/expat/dist/win32/README.txt        up to 1.1.1.5
	external/mit/expat/dist/win32/expat.iss         up to 1.1.1.6
	external/mit/expat/dist/xmlwf/codepage.c        up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.h        up to 1.1.1.2
	external/mit/expat/dist/xmlwf/ct.c              up to 1.1.1.2
	external/mit/expat/dist/xmlwf/filemap.h         up to 1.1.1.3
	external/mit/expat/dist/xmlwf/readfilemap.c     up to 1.1.1.5
	external/mit/expat/dist/xmlwf/unixfilemap.c     up to 1.1.1.4
	external/mit/expat/dist/xmlwf/win32filemap.c    up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c         up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlfile.h         up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlmime.c         up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlmime.h         up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmltchar.h        up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c           up to 1.1.1.6
	external/mit/expat/lib/libexpat/expat_config.h  up to 1.6
	doc/3RDPARTY					1.1649
	external/mit/xorg/tools/fc-cache/Makefile	1.18

Update expat to 2.2.8.
Define XML_POOR_ENTROPY for the tool version of fc-cache
(we can not assume anything about the build host).
@
text
@d4 1
a4 1
scriptversion=2016-01-11.22; # UTC
a326 2
            # $RANDOM is not portable (e.g. dash);  use it when possible to
            # lower collision chance
d328 1
a328 1
            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
a329 3
            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
            # create the $tmpdir first (and fail if unsuccessful) to make sure
            # that nobody tries to guess the $tmpdir name.
d331 1
a331 2
                $mkdirprog $mkdir_mode "$tmpdir" &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
d338 1
a338 2
                   test_tmpdir="$tmpdir/a"
                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
d344 2
a345 2
                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
d351 1
a351 1
              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
d354 1
a354 1
              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
d499 1
a499 1
# time-stamp-time-zone: "UTC0"
@


1.1.1.4.4.1
log
@Sync external/mit/expat to current and pull up the following revisions,
requested by maya in ticket #1376:

	external/mit/expat/dist/conftools/test-driver	up to 1.1.1.1
	external/mit/expat/dist/conftools/ar-lib	up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-compile-flags.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-append-link-flags.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-check-compile-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-check-link-flag.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/ax-require-defined.m4 up to 1.1.1.1
	external/mit/expat/dist/conftools/compile	up to 1.1.1.1
	external/mit/expat/dist/conftools/depcomp	up to 1.1.1.1
	external/mit/expat/dist/conftools/missing	up to 1.1.1.1
	external/mit/expat/dist/conftools/expatcfg-compiler-supports-visibility.m4 up to 1.1.1.1
	external/mit/expat/dist/doc/Makefile.am 	up to 1.1.1.1
	external/mit/expat/dist/doc/Makefile.in 	up to 1.1.1.1
	external/mit/expat/dist/examples/Makefile.am	up to 1.1.1.1
	external/mit/expat/dist/examples/Makefile.in	up to 1.1.1.1
	external/mit/expat/dist/lib/Makefile.am 	up to 1.1.1.1
	external/mit/expat/dist/lib/Makefile.in 	up to 1.1.1.1
	external/mit/expat/dist/tests/benchmark/Makefile.am up to 1.1.1.1
	external/mit/expat/dist/tests/benchmark/Makefile.in up to 1.1.1.1
	external/mit/expat/dist/tests/Makefile.am	up to 1.1.1.1
	external/mit/expat/dist/tests/Makefile.in	up to 1.1.1.1
	external/mit/expat/dist/tests/structdata.c	up to 1.1.1.1
	external/mit/expat/dist/tests/structdata.h	up to 1.1.1.1
	external/mit/expat/dist/tests/udiffer.py	up to 1.1.1.1
	external/mit/expat/dist/tests/xmltest.log.expected up to 1.1.1.1
	external/mit/expat/dist/win32/build_expat_iss.bat up to 1.1.1.1
	external/mit/expat/dist/xmlwf/Makefile.am	up to 1.1.1.1
	external/mit/expat/dist/xmlwf/Makefile.in	up to 1.1.1.1
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.py	up to 1.1.1.1
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.sh	up to 1.1.1.1
	external/mit/expat/dist/Makefile.am		up to 1.1.1.1
	external/mit/expat/dist/README.md		up to 1.1.1.1
	external/mit/expat/dist/cmake/expat-config.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/mingw-toolchain.cmake up to 1.1.1.1
	external/mit/expat/dist/acinclude.m4		up to 1.1.1.1
	external/mit/expat/dist/fix-xmltest-log.sh	up to 1.1.1.1
	external/mit/expat/dist/test-driver-wrapper.sh	up to 1.1.1.1
	external/mit/expat/dist/MANIFEST		delete
	external/mit/expat/dist/README			delete
	external/mit/expat/dist/conftools/ac_c_bigendian_cross.m4 delete
	external/mit/expat/dist/conftools/mkinstalldirs delete
	external/mit/expat/dist/xmlwf/xmlurl.h		delete
	external/mit/expat/dist/xmlwf/xmlwin32url.cxx	delete
	external/mit/expat/dist/CMake.README		up to 1.1.1.5
	external/mit/expat/dist/CMakeLists.txt		up to 1.1.1.5
	external/mit/expat/dist/Changes 		up to 1.1.1.6
	external/mit/expat/dist/ConfigureChecks.cmake	up to 1.1.1.2
	external/mit/expat/dist/Makefile.in		up to 1.1.1.6
	external/mit/expat/dist/aclocal.m4		up to 1.1.1.4
	external/mit/expat/dist/configure		up to 1.1.1.6
	external/mit/expat/dist/configure.ac		up to 1.1.1.4
	external/mit/expat/dist/expat_config.h.cmake	up to 1.1.1.2
	external/mit/expat/dist/expat_config.h.in	up to 1.1.1.6
	external/mit/expat/dist/conftools/config.guess	up to 1.4
	external/mit/expat/dist/conftools/config.sub	up to 1.4
	external/mit/expat/dist/conftools/get-version.sh up to 1.1.1.2
	external/mit/expat/dist/conftools/install-sh	up to 1.1.1.5
	external/mit/expat/dist/conftools/ltmain.sh	up to 1.1.1.5
	external/mit/expat/dist/doc/reference.html	up to 1.1.1.5
	external/mit/expat/dist/doc/xmlwf.1		up to 1.1.1.4
	external/mit/expat/dist/doc/xmlwf.xml		up to 1.1.1.2
	external/mit/expat/dist/examples/elements.c	up to 1.1.1.5
	external/mit/expat/dist/examples/outline.c	up to 1.1.1.4
	external/mit/expat/dist/lib/ascii.h		up to 1.1.1.2
	external/mit/expat/dist/lib/asciitab.h		up to 1.1.1.2
	external/mit/expat/dist/lib/expat.h		up to 1.1.1.6
	external/mit/expat/dist/lib/expat_external.h	up to 1.1.1.4
	external/mit/expat/dist/lib/iasciitab.h 	up to 1.1.1.2
	external/mit/expat/dist/lib/internal.h		up to 1.1.1.3
	external/mit/expat/dist/lib/latin1tab.h 	up to 1.1.1.2
	external/mit/expat/dist/lib/libexpat.def	up to 1.1.1.3
	external/mit/expat/dist/lib/libexpatw.def	up to 1.1.1.3
	external/mit/expat/dist/lib/nametab.h		up to 1.1.1.2
	external/mit/expat/dist/lib/siphash.h		up to 1.1.1.2
	external/mit/expat/dist/lib/utf8tab.h		up to 1.1.1.2
	external/mit/expat/dist/lib/winconfig.h 	up to 1.1.1.3
	external/mit/expat/dist/lib/xmlparse.c		up to 1.8
	external/mit/expat/dist/lib/xmlrole.c		up to 1.1.1.5
	external/mit/expat/dist/lib/xmlrole.h		up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok.c		up to 1.5
	external/mit/expat/dist/lib/xmltok.h		up to 1.3
	external/mit/expat/dist/lib/xmltok_impl.c	up to 1.6
	external/mit/expat/dist/lib/xmltok_impl.h	up to 1.1.1.2
	external/mit/expat/dist/lib/xmltok_ns.c 	up to 1.1.1.2
	external/mit/expat/dist/tests/chardata.c	up to 1.1.1.4
	external/mit/expat/dist/tests/chardata.h	up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.c	up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.h	up to 1.1.1.2
	external/mit/expat/dist/tests/minicheck.c	up to 1.1.1.4
	external/mit/expat/dist/tests/minicheck.h	up to 1.1.1.5
	external/mit/expat/dist/tests/runtests.c	up to 1.1.1.5
	external/mit/expat/dist/tests/runtestspp.cpp	up to 1.1.1.2
	external/mit/expat/dist/tests/xmltest.sh	up to 1.4
	external/mit/expat/dist/tests/benchmark/benchmark.c up to 1.1.1.3
	external/mit/expat/dist/win32/README.txt	up to 1.1.1.5
	external/mit/expat/dist/win32/expat.iss 	up to 1.1.1.6
	external/mit/expat/dist/xmlwf/codepage.c	up to 1.1.1.4
	external/mit/expat/dist/xmlwf/codepage.h	up to 1.1.1.2
	external/mit/expat/dist/xmlwf/ct.c		up to 1.1.1.2
	external/mit/expat/dist/xmlwf/filemap.h 	up to 1.1.1.3
	external/mit/expat/dist/xmlwf/readfilemap.c	up to 1.1.1.5
	external/mit/expat/dist/xmlwf/unixfilemap.c	up to 1.1.1.4
	external/mit/expat/dist/xmlwf/win32filemap.c	up to 1.1.1.3
	external/mit/expat/dist/xmlwf/xmlfile.c 	up to 1.1.1.4
	external/mit/expat/dist/xmlwf/xmlfile.h 	up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlmime.c 	up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlmime.h         up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmltchar.h        up to 1.1.1.2
	external/mit/expat/dist/xmlwf/xmlwf.c           up to 1.1.1.6
	external/mit/expat/lib/libexpat/expat_config.h  up to 1.6
	doc/3RDPARTY					1.1649 (patch)
	external/mit/xorg/tools/fc-cache/Makefile	1.18 (patch)

Update expat to 2.2.8.
Define XML_POOR_ENTROPY for the tool version of fc-cache
(we can not assume anything about the build host).
@
text
@d4 1
a4 1
scriptversion=2016-01-11.22; # UTC
a326 2
            # $RANDOM is not portable (e.g. dash);  use it when possible to
            # lower collision chance
d328 1
a328 1
            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
a329 3
            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
            # create the $tmpdir first (and fail if unsuccessful) to make sure
            # that nobody tries to guess the $tmpdir name.
d331 1
a331 2
                $mkdirprog $mkdir_mode "$tmpdir" &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
d338 1
a338 2
                   test_tmpdir="$tmpdir/a"
                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
d344 2
a345 2
                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
d351 1
a351 1
              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
d354 1
a354 1
              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
d499 1
a499 1
# time-stamp-time-zone: "UTC0"
@


1.1.1.5
log
@Import expat 2.2.8

Release 2.2.8 Fri Septemper 13 2019
        Security fixes:
       #317 #318  CVE-2019-15903 -- Fix heap overflow triggered by
                    XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber),
                    and deny internal entities closing the doctype;
                    fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43

        Bug fixes:
            #240  Fix cases where XML_StopParser did not have any effect
                    when called from inside of an end element handler
            #341  xmlwf: Fix exit code for operation without "-d DIRECTORY";
                    previously, only "-d DIRECTORY" would give you a proper
                    exit code:
                      # xmlwf -d . <<<'<not well-formed>' 2>/dev/null ; echo $?
                      2
                      # xmlwf <<<'<not well-formed>' 2>/dev/null ; echo $?
                      0
                    Now both cases return exit code 2.

        Other changes:
       #299 #302  Windows: Replace LoadLibrary hack to access
                    unofficial API function SystemFunction036 (RtlGenRandom)
                    by using official API function rand_s (needs WinXP+)
            #325  Windows: Drop support for Visual Studio <=7.1/2003
                    and document supported compilers in README.md
            #286  Windows: Remove COM code from xmlwf; in case it turns
                    out needed later, there will be a dedicated repository
                    below https://github.com/libexpat/ for that code
            #322  Windows: Remove explicit MSVC solution and project files.
                    You can generate Visual Studio solution files through
                    CMake, e.g.: cmake -G"Visual Studio 15 2017" .
            #338  xmlwf: Make "xmlwf -h" help output more friendly
            #339  examples: Improve elements.c
       #244 #264  Autotools: Add argument --enable-xml-attr-info
       #239 #301  Autotools: Add arguments
                    --with-getrandom
                    --without-getrandom
                    --with-sys-getrandom
                    --without-sys-getrandom
       #312 #343  Autotools: Fix linking issues with "./configure LD=clang"
                  Autotools: Fix "make run-xmltest" for out-of-source builds
       #329 #336  CMake: Pull all options from Expat <=2.2.7 into namespace
                    prefix EXPAT_ with the exception of DOCBOOK_TO_MAN:
                    - BUILD_doc            -> EXPAT_BUILD_DOCS (plural)
                    - BUILD_examples       -> EXPAT_BUILD_EXAMPLES
                    - BUILD_shared         -> EXPAT_SHARED_LIBS
                    - BUILD_tests          -> EXPAT_BUILD_TESTS
                    - BUILD_tools          -> EXPAT_BUILD_TOOLS
                    - DOCBOOK_TO_MAN       -> DOCBOOK_TO_MAN (unchanged)
                    - INSTALL              -> EXPAT_ENABLE_INSTALL
                    - MSVC_USE_STATIC_CRT  -> EXPAT_MSVC_STATIC_CRT
                    - USE_libbsd           -> EXPAT_WITH_LIBBSD
                    - WARNINGS_AS_ERRORS   -> EXPAT_WARNINGS_AS_ERRORS
                    - XML_CONTEXT_BYTES    -> EXPAT_CONTEXT_BYTES
                    - XML_DEV_URANDOM      -> EXPAT_DEV_URANDOM
                    - XML_DTD              -> EXPAT_DTD
                    - XML_NS               -> EXPAT_NS
                    - XML_UNICODE          -> EXPAT_CHAR_TYPE=ushort (!)
                    - XML_UNICODE_WCHAR_T  -> EXPAT_CHAR_TYPE=wchar_t (!)
       #244 #264  CMake: Add argument -DEXPAT_ATTR_INFO=(ON|OFF),
                    default OFF
            #326  CMake: Add argument -DEXPAT_LARGE_SIZE=(ON|OFF),
                    default OFF
            #328  CMake: Add argument -DEXPAT_MIN_SIZE=(ON|OFF),
                    default OFF
       #239 #277  CMake: Add arguments
                    -DEXPAT_WITH_GETRANDOM=(ON|OFF|AUTO), default AUTO
                    -DEXPAT_WITH_SYS_GETRANDOM=(ON|OFF|AUTO), default AUTO
            #326  CMake: Install expat_config.h to include directory
            #326  CMake: Generate and install configuration files for
                    future find_package(expat [..] CONFIG [..])
                  CMake: Now produces a summary of applied configuration
                  CMake: Require C++ compiler only when tests are enabled
            #330  CMake: Fix compilation for 16bit character types,
                    i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON)
            #265  CMake: Fix linking with MinGW
            #330  CMake: Add full support for MinGW; to enable, use
                    -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake
            #330  CMake: Port "make run-xmltest" from GNU Autotools to CMake
            #316  CMake: Windows: Make binary postfix match MSVC
                    Old: expat[d].lib
                    New: expat[w][d][MD|MT].lib
                  CMake: Migrate files from Windows to Unix line endings
            #308  CMake: Integrate OSS-Fuzz fuzzers, option
                    -DEXPAT_BUILD_FUZZERS=(ON|OFF), default OFF
             #14  Drop an OpenVMS support leftover
    #235 #268 ..
    #270 #310 ..
  #313 #331 #333  Address compiler warnings
    #282 #283 ..
       #284 #285  Address cppcheck warnings
       #294 #295  Address Clang Static Analyzer warnings
        #24 #293  Mass-apply clang-format 9 (and ensure conformance during CI)
                  Version info bumped from 7:9:6 to 7:10:6

        Special thanks to:
            David Loffredo
            Joonun Jang
            Khajapasha Mohammed
            Kishore Kunche
            Marco Maggi
            Mitch Phillips
            Rolf Ade
            xantares
            Zhongyuan Zhou
@
text
@d4 1
a4 1
scriptversion=2016-01-11.22; # UTC
a326 2
            # $RANDOM is not portable (e.g. dash);  use it when possible to
            # lower collision chance
d328 1
a328 1
            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
a329 3
            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
            # create the $tmpdir first (and fail if unsuccessful) to make sure
            # that nobody tries to guess the $tmpdir name.
d331 1
a331 2
                $mkdirprog $mkdir_mode "$tmpdir" &&
                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
d338 1
a338 2
                   test_tmpdir="$tmpdir/a"
                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
d344 2
a345 2
                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
d351 1
a351 1
              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
d354 1
a354 1
              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
d499 1
a499 1
# time-stamp-time-zone: "UTC0"
@


1.1.1.6
log
@Upgrade expat from 2.2.8 -> 2.4.6 to include the security fixes from 2.4.5

Release 2.4.6 Sun February 20 2022
        Bug fixes:
            #566  Fix a regression introduced by the fix for CVE-2022-25313
                    in release 2.4.5 that affects applications that (1)
                    call function XML_SetElementDeclHandler and (2) are
                    parsing XML that contains nested element declarations
                    (e.g. "<!ELEMENT junk ((bar|foo|xyz+), zebra*)>").

        Other changes:
       #567 #568  Version info bumped from 9:5:8 to 9:6:8;
                    see https://verbump.de/ for what these numbers do

        Special thanks to:
            Matt Sergeant
            Samanta Navarro
            Sergei Trofimovich
                 and
            NixOS
            Perl XML::Parser

Release 2.4.5 Fri February 18 2022
        Security fixes:
            #562  CVE-2022-25235 -- Passing malformed 2- and 3-byte UTF-8
                    sequences (e.g. from start tag names) to the XML
                    processing application on top of Expat can cause
                    arbitrary damage (e.g. code execution) depending
                    on how invalid UTF-8 is handled inside the XML
                    processor; validation was not their job but Expat's.
                    Exploits with code execution are known to exist.
            #561  CVE-2022-25236 -- Passing (one or more) namespace separator
                    characters in "xmlns[:prefix]" attribute values
                    made Expat send malformed tag names to the XML
                    processor on top of Expat which can cause
                    arbitrary damage (e.g. code execution) depending
                    on such unexpectable cases are handled inside the XML
                    processor; validation was not their job but Expat's.
                    Exploits with code execution are known to exist.
            #558  CVE-2022-25313 -- Fix stack exhaustion in doctype parsing
                    that could be triggered by e.g. a 2 megabytes
                    file with a large number of opening braces.
                    Expected impact is denial of service or potentially
                    arbitrary code execution.
            #560  CVE-2022-25314 -- Fix integer overflow in function copyString;
                    only affects the encoding name parameter at parser creation
                    time which is often hardcoded (rather than user input),
                    takes a value in the gigabytes to trigger, and a 64-bit
                    machine.  Expected impact is denial of service.
            #559  CVE-2022-25315 -- Fix integer overflow in function storeRawNames;
                    needs input in the gigabytes and a 64-bit machine.
                    Expected impact is denial of service or potentially
                    arbitrary code execution.

        Other changes:
       #557 #564  Version info bumped from 9:4:8 to 9:5:8;
                    see https://verbump.de/ for what these numbers do

        Special thanks to:
            Ivan Fratric
            Samanta Navarro
                 and
            Google Project Zero
            JetBrains

Release 2.4.4 Sun January 30 2022
        Security fixes:
            #550  CVE-2022-23852 -- Fix signed integer overflow
                    (undefined behavior) in function XML_GetBuffer
                    (that is also called by function XML_Parse internally)
                    for when XML_CONTEXT_BYTES is defined to >0 (which is both
                    common and default).
                    Impact is denial of service or more.
            #551  CVE-2022-23990 -- Fix unsigned integer overflow in function
                    doProlog triggered by large content in element type
                    declarations when there is an element declaration handler
                    present (from a prior call to XML_SetElementDeclHandler).
                    Impact is denial of service or more.

        Bug fixes:
       #544 #545  xmlwf: Fix a memory leak on output file opening error

        Other changes:
            #546  Autotools: Fix broken CMake support under Cygwin
            #554  Windows: Add missing files to the installer to fix
                    compilation with CMake from installed sources
       #552 #554  Version info bumped from 9:3:8 to 9:4:8;
                    see https://verbump.de/ for what these numbers do

        Special thanks to:
            Carlo Bramini
            hwt0415
            Roland Illig
            Samanta Navarro
                 and
            Clang LeakSan and the Clang team

Release 2.4.3 Sun January 16 2022
        Security fixes:
       #531 #534  CVE-2021-45960 -- Fix issues with left shifts by >=29 places
                    resulting in
                      a) realloc acting as free
                      b) realloc allocating too few bytes
                      c) undefined behavior
                    depending on architecture and precise value
                    for XML documents with >=2^27+1 prefixed attributes
                    on a single XML tag a la
                    "<r xmlns:a='[..]' a:a123='[..]' [..] />"
                    where XML_ParserCreateNS is used to create the parser
                    (which needs argument "-n" when running xmlwf).
                    Impact is denial of service, or more.
       #532 #538  CVE-2021-46143 (ZDI-CAN-16157) -- Fix integer overflow
                    on variable m_groupSize in function doProlog leading
                    to realloc acting as free.
                    Impact is denial of service or more.
            #539  CVE-2022-22822 to CVE-2022-22827 -- Prevent integer overflows
                    near memory allocation at multiple places.  Mitre assigned
                    a dedicated CVE for each involved internal C function:
                    - CVE-2022-22822 for function addBinding
                    - CVE-2022-22823 for function build_model
                    - CVE-2022-22824 for function defineAttribute
                    - CVE-2022-22825 for function lookup
                    - CVE-2022-22826 for function nextScaffoldPart
                    - CVE-2022-22827 for function storeAtts
                    Impact is denial of service or more.

        Other changes:
            #535  CMake: Make call to file(GENERATE [..]) work for CMake <3.19
            #541  Autotools|CMake: MinGW: Make run.sh(.in) work for Cygwin
                    and MSYS2 by not going through Wine on these platforms
       #527 #528  Address compiler warnings
       #533 #543  Version info bumped from 9:2:8 to 9:3:8;
                    see https://verbump.de/ for what these numbers do

        Infrastructure:
            #536  CI: Check for realistic minimum CMake version
       #529 #539  CI: Cover compilation with -m32
            #529  CI: Store coverage reports as artifacts for download
            #528  CI: Upgrade Clang from 11 to 13

        Special thanks to:
            An anonymous whitehat
            Christopher Degawa
            J. Peter Mugaas
            Tyson Smith
                 and
            GCC Farm Project
            Trend Micro Zero Day Initiative

Release 2.4.2 Sun December 19 2021
        Other changes:
       #509 #510  Link againgst libm for function "isnan"
       #513 #514  Include expat_config.h as early as possible
            #498  Autotools: Include files with release archives:
                    - buildconf.sh
                    - fuzz/*.c
       #507 #519  Autotools: Sync CMake templates
       #495 #524  CMake: MinGW: Fix pkg-config section "Libs" for
                    - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug)
                    - multi-config CMake generators (e.g. Ninja Multi-Config)
       #502 #503  docs: Document that function XML_GetBuffer may return NULL
                    when asking for a buffer of 0 (zero) bytes size
       #522 #523  docs: Fix return value docs for both
                    XML_SetBillionLaughsAttackProtection* functions
       #525 #526  Version info bumped from 9:1:8 to 9:2:8;
                    see https://verbump.de/ for what these numbers do

        Special thanks to:
            Dong-hee Na
            Joergen Ibsen
            Kai Pastor

Release 2.4.1 Sun May 23 2021
        Bug fixes:
       #488 #490  Autotools: Fix installed header expat_config.h for multilib
                    systems; regression introduced in 2.4.0 by pull request #486

        Other changes:
       #491 #492  Version info bumped from 9:0:8 to 9:1:8;
                    see https://verbump.de/ for what these numbers do

        Special thanks to:
            Gentoo's QA check "multilib_check_headers"

Release 2.4.0 Sun May 23 2021
        Security fixes:
   #34 #466 #484  CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks
                    (denial-of-service; flavors targeting CPU time or RAM or both,
                    leveraging general entities or parameter entities or both)
                    by tracking and limiting the input amplification factor
                    (<amplification> := (<direct> + <indirect>) / <direct>).
                    By conservative default, amplification up to a factor of 100.0
                    is tolerated and rejection only starts after 8 MiB of output bytes
                    (=<direct> + <indirect>) have been processed.
                    The fix adds the following to the API:
                    - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to
                      signals this specific condition.
                    - Two new API functions ..
                      - XML_SetBillionLaughsAttackProtectionMaximumAmplification and
                      - XML_SetBillionLaughsAttackProtectionActivationThreshold
                      .. to further tighten billion laughs protection parameters
                      when desired.  Please see file "doc/reference.html" for details.
                      If you ever need to increase the defaults for non-attack XML
                      payload, please file a bug report with libexpat.
                    - Two new XML_FEATURE_* constants ..
                      - that can be queried using the XML_GetFeatureList function, and
                      - that are shown in "xmlwf -v" output.
                    - Two new environment variable switches ..
                      - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and
                      - EXPAT_ENTITY_DEBUG=(0|1)
                      .. for runtime debugging of accounting and entity processing.
                      Specific behavior of these values may change in the future.
                    - Two new command line arguments "-a FACTOR" and "-b BYTES"
                      for xmlwf to further tighten billion laughs protection
                      parameters when desired.
                      If you ever need to increase the defaults for non-attack XML
                      payload, please file a bug report with libexpat.

        Bug fixes:
       #332 #470  For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake)
                    or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault
                    for UTF-16 payloads containing CDATA sections.
       #485 #486  Autotools: Fix generated CMake files for non-64bit and
                    non-Linux platforms (e.g. macOS and MinGW in particular)
                    that were introduced with release 2.3.0

        Other changes:
       #468 #469  xmlwf: Improve help output and the xmlwf man page
            #463  xmlwf: Improve maintainability through some refactoring
            #477  xmlwf: Fix man page DocBook validity
       #458 #459  CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR
                    and CMAKE_INSTALL_INCLUDEDIR
       #471 #481  CMake: Add support for standard variable BUILD_SHARED_LIBS
            #457  Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters
            #467  Resolve macro HAVE_EXPAT_CONFIG_H
            #472  Delete unused legacy helper file "conftools/PrintPath"
       #473 #483  Improve attribution
  #464 #465 #477  doc/reference.html: Fix XHTML validity
       #475 #478  doc/reference.html: Replace the 90s look by OK.css
            #479  Version info bumped from 8:0:7 to 9:0:8
                    due to addition of new symbols and error codes;
                    see https://verbump.de/ for what these numbers do

        Infrastructure:
            #456  CI: Enable periodic runs
            #457  CI: Start covering the list of exported symbols
            #474  CI: Isolate coverage task
       #476 #482  CI: Adapt to breaking changes in image "ubuntu-18.04"
            #477  CI: Cover well-formedness and DocBook/XHTML validity
                    of doc/reference.html and doc/xmlwf.xml

        Special thanks to:
            Dimitry Andric
            Eero Helenius
            Nick Wellnhofer
            Rhodri James
            Tomas Korbar
            Yury Gribov
                 and
            Clang LeakSan
            JetBrains
            OSS-Fuzz

Release 2.3.0 Thu March 25 2021
        Bug fixes:
            #438  When calling XML_ParseBuffer without a prior successful call to
                    XML_GetBuffer as a user, no longer trigger undefined behavior
                    (by adding an integer to a NULL pointer) but rather return
                    XML_STATUS_ERROR and set the error code to (new) code
                    XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer)
                    of Clang 11 (but not Clang 9).
            #444  xmlwf: Exit status 2 was used for both:
                    - malformed input files (documented) and
                    - invalid command-line arguments (undocumented).
                    The case of invalid command-line arguments now
                    has its own exit status 4, resolving the ambiguity.

        Other changes:
            #439  xmlwf: Add argument -k to allow continuing after
                    non-fatal errors
            #439  xmlwf: Add section about exit status to the -h help output
  #422 #426 #447  Windows: Drop support for Visual Studio <=14.0/2015
            #434  Windows: CMake: Detect unsupported Visual Studio at
                    configure time (rather than at compile time)
       #382 #428  testrunner: Make verbose mode (argument "-v") report
                    about passed tests, and make default mode report about
                    failures, as well.
            #442  CMake: Call "enable_language(CXX)" prior to tinkering
                    with CMAKE_CXX_* variables
            #448  Document use of libexpat from a CMake-based project
            #451  Autotools: Install CMake files as generated by CMake 3.19.6
                    so that users with "find_package(expat [..] CONFIG [..])"
                    are served on distributions that are *not* using the CMake
                    build system inside for libexpat packaging
       #436 #437  Autotools: Drop obsolescent macro AC_HEADER_STDC
       #450 #452  Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER
            #441  Address compiler warnings
            #443  Version info bumped from 7:12:6 to 8:0:7
                    due to addition of error code XML_ERROR_NO_BUFFER
                    (see https://verbump.de/ for what these numbers do)

        Infrastructure:
       #435 #446  Replace Travis CI by GitHub Actions

        Special thanks to:
            Alexander Richardson
            Oleksandr Popovych
            Thomas Beutlich
            Tim Bray
                 and
            Clang LeakSan, Clang 11 UBSan and the Clang team

Release 2.2.10 Sat October 3 2020
        Bug fixes:
  #390 #395 #398  Fix undefined behavior during parsing caused by
                    pointer arithmetic with NULL pointers
       #404 #405  Fix reading uninitialized variable during parsing
            #406  xmlwf: Add missing check for malloc NULL return

        Other changes:
            #396  Windows: Drop support for Visual Studio <=8.0/2005
            #409  Windows: Add missing file "Changes" to the installer
                    to fix compilation with CMake from installed sources
            #403  xmlwf: Document exit codes in xmlwf manpage and
                    exit with code 3 (rather than code 1) for output errors
                    when used with "-d DIRECTORY"
       #356 #359  MinGW: Provide declaration of rand_s for mingwrt <5.3.0
       #383 #392  Autotools: Use -Werror while configure tests the compiler
                    for supported compile flags to avoid false positives
  #383 #393 #394  Autotools: Improve handling of user (C|CPP|CXX|LD)FLAGS,
                    e.g. ensure that they have the last word over flags added
                    while running ./configure
            #360  CMake: Create libexpatw.{dll,so} and expatw.pc (with emphasis
                    on suffix "w") with -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
            #360  CMake: Detect and deny unsupported build combinations
                    involving -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
            #360  CMake: Install pre-compiled shipped xmlwf.1 manpage in case
                    of -DEXPAT_BUILD_DOCS=OFF
  #375 #380 #419  CMake: Fix use of Expat by means of add_subdirectory
       #407 #408  CMake: Keep expat target name constant at "expat"
                    (i.e. refrain from using the target name to control
                    build artifact filenames)
            #385  CMake: Fix compilation with -DEXPAT_SHARED_LIBS=OFF for
                    Windows
                  CMake: Expose man page compilation as target "xmlwf-manpage"
       #413 #414  CMake: Introduce option EXPAT_BUILD_PKGCONFIG
                    to control generation of pkg-config file "expat.pc"
            #424  CMake: Add minimalistic support for building binary packages
                    with CMake target "package"; based on CPack
            #366  CMake: Add option -DEXPAT_OSSFUZZ_BUILD=(ON|OFF) with
                    default OFF to build fuzzer code against OSS-Fuzz and
                    related environment variable LIB_FUZZING_ENGINE
            #354  Fix testsuite for -DEXPAT_DTD=OFF and -DEXPAT_NS=OFF, each
    #354 #355 ..
       #356 #412  Address compiler warnings
       #368 #369  Address pngcheck warnings with doc/*.png images
            #425  Version info bumped from 7:11:6 to 7:12:6

        Special thanks to:
            asavah
            Ben Wagner
            Bhargava Shastry
            Frank Landgraf
            Jeffrey Walton
            Joe Orton
            Kleber Tarcísio
            Ma Lin
            Maciej Sroczy#ski
            Mohammed Khajapasha
            Vadim Zeitlin
                 and
            Cppcheck 2.0 and the Cppcheck team

Release 2.2.9 Wed September 25 2019
        Other changes:
                  examples: Drop executable bits from elements.c
            #349  Windows: Change the name of the Windows DLLs from expat*.dll
                    to libexpat*.dll once more (regression from 2.2.8, first
                    fixed in 1.95.3, issue #61 on SourceForge today,
                    was issue #432456 back then); needs a fix due
                    case-insensitive file systems on Windows and the fact that
                    Perl's XML::Parser::Expat compiles into Expat.dll.
            #347  Windows: Only define _CRT_RAND_S if not defined
                  Version info bumped from 7:10:6 to 7:11:6

        Special thanks to:
            Ben Wagner
@
text
@d4 1
a4 1
scriptversion=2020-11-14.01; # UTC
a71 5
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22

backupsuffix=
d102 1
a102 1
  -C            install only if different (preserve data modification time)
a106 1
  -p            pass -p to $cpprog.
a107 1
  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.
a113 8

By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.

If -S is not specified, no backups are attempted.

Email bug reports to bug-automake@@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
a139 2
    -p) cpprog="$cpprog -p";;

a141 3
    -S) backupsuffix="$2"
        shift;;

a257 4
    # Don't chown directories that already exist.
    if test $dstdir_status = 0; then
      chowncmd=""
    fi
d274 2
a275 1
    # If destination is a directory, append the input filename.
d282 1
a282 5
      dstbase=`basename "$src"`
      case $dst in
	*/) dst=$dst$dstbase;;
	*)  dst=$dst/$dstbase;;
      esac
a290 5
  case $dstdir in
    */) dstdirslash=$dstdir;;
    *)  dstdirslash=$dstdir/;;
  esac

d296 16
d321 44
a364 43
	# The $RANDOM variable is not portable (e.g., dash).  Use it
	# here however when possible just to lower collision chance.
	tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$

	trap '
	  ret=$?
	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
	  exit $ret
	' 0

	# Because "mkdir -p" follows existing symlinks and we likely work
	# directly in world-writeable /tmp, make sure that the '$tmpdir'
	# directory is successfully created first before we actually test
	# 'mkdir -p'.
	if (umask $mkdir_umask &&
	    $mkdirprog $mkdir_mode "$tmpdir" &&
	    exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
	then
	  if test -z "$dir_arg" || {
	       # Check for POSIX incompatibilities with -m.
	       # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
	       # other-writable bit of parent directory when it shouldn't.
	       # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
	       test_tmpdir="$tmpdir/a"
	       ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
	       case $ls_ld_tmpdir in
		 d????-?r-*) different_mode=700;;
		 d????-?--*) different_mode=755;;
		 *) false;;
	       esac &&
	       $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
		 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
		 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
	       }
	     }
	  then posix_mkdir=:
	  fi
	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
	else
	  # Remove any dirs left behind by ancient mkdir implementations.
	  rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
	fi
	trap '' 0;;
d375 1
a375 1
      # mkdir does not conform to POSIX,
d404 1
a404 1
            (umask $mkdir_umask &&
d437 2
a438 2
    dsttmp=${dstdirslash}_inst.$$_
    rmtmp=${dstdirslash}_rm.$$_
d444 1
a444 12
    (umask $cp_umask &&
     { test -z "$stripcmd" || {
	 # Create $dsttmp read-write so that cp doesn't create it read-only,
	 # which would cause strip to fail.
	 if test -z "$doit"; then
	   : >"$dsttmp" # No need to fork-exec 'touch'.
	 else
	   $doit touch "$dsttmp"
	 fi
       }
     } &&
     $doit_exec $cpprog "$src" "$dsttmp") &&
a469 7
      # If $backupsuffix is set, and the file being installed
      # already exists, attempt a backup.  Don't worry if it fails,
      # e.g., if mv doesn't support -f.
      if test -n "$backupsuffix" && test -f "$dst"; then
        $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
      fi

d484 1
a484 1
          $doit $rmcmd "$dst" 2>/dev/null ||
d486 1
a486 1
            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
d503 1
a503 1
# eval: (add-hook 'before-save-hook 'time-stamp)
@


1.1.1.6.6.1
log
@Pull up the following revisions, requested by jdc in ticket #311:

	external/mit/expat/dist/lib/libexpat.map.in     up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random_buf.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_arc4random_buf.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_dev_urandom.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_dev_urandom.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_getentropy.c up to 1.1.1.1
	external/mit/expat/dist/lib/random_getentropy.h up to 1.1.1.1
	external/mit/expat/dist/lib/random_getrandom.c  up to 1.1.1.1
	external/mit/expat/dist/lib/random_getrandom.h  up to 1.1.1.1
	external/mit/expat/dist/lib/random_rand_s.c     up to 1.1.1.1
	external/mit/expat/dist/lib/random_rand_s.h     up to 1.1.1.1
	external/mit/expat/dist/coverage.sh             up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__linux.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__macos.cmake.in up to 1.1.1.1
	external/mit/expat/dist/cmake/autotools/expat__windows.cmake.in up to 1.1.1.1
	external/mit/expat/dist/qa.sh                   up to 1.1.1.1
	external/mit/expat/dist/gennmtab/gennmtab.c     up to 1.1.1.1
	external/mit/expat/dist/.clang-format           up to 1.1.1.1
	external/mit/expat/dist/apply-clang-format.sh   up to 1.1.1.1
	external/mit/expat/dist/apply-clang-tidy.sh     up to 1.1.1.1
	external/mit/expat/dist/clean_coverage.sh       up to 1.1.1.1
	external/mit/expat/dist/configure-ac-style.md   up to 1.1.1.1
	external/mit/expat/dist/distribute.sh           up to 1.1.1.1
	external/mit/expat/dist/memory-sanitizer-blacklist.txt up to 1.1.1.1
	external/mit/expat/dist/Makefile.in             delete
	external/mit/expat/dist/aclocal.m4              delete
	external/mit/expat/dist/configure               delete
	external/mit/expat/dist/expat_config.h.in       delete
	external/mit/expat/dist/cmake/autotools/expat.cmake delete
	external/mit/expat/dist/conftools/compile       delete
	external/mit/expat/dist/conftools/ar-lib        delete
	external/mit/expat/dist/conftools/config.guess  delete
	external/mit/expat/dist/conftools/config.sub    delete
	external/mit/expat/dist/conftools/depcomp       delete
	external/mit/expat/dist/conftools/expat.m4      delete
	external/mit/expat/dist/conftools/missing       delete
	external/mit/expat/dist/conftools/install-sh    delete
	external/mit/expat/dist/conftools/ltmain.sh     delete
	external/mit/expat/dist/conftools/test-driver   delete
	external/mit/expat/dist/doc/Makefile.in         delete
	external/mit/expat/dist/doc/xmlwf.1             delete
	external/mit/expat/dist/examples/Makefile.in    delete
	external/mit/expat/dist/lib/Makefile.in         delete
	external/mit/expat/dist/m4/libtool.m4           delete
	external/mit/expat/dist/m4/ltoptions.m4         delete
	external/mit/expat/dist/m4/ltsugar.m4           delete
	external/mit/expat/dist/m4/ltversion.m4         delete
	external/mit/expat/dist/m4/lt~obsolete.m4       delete
	external/mit/expat/dist/tests/benchmark/Makefile.in delete
	external/mit/expat/dist/tests/Makefile.in       delete
	external/mit/expat/dist/tests/acc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/alloc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/basic_tests_cxx.cpp delete
	external/mit/expat/dist/tests/chardata_cxx.cpp  delete
	external/mit/expat/dist/tests/common_cxx.cpp    delete
	external/mit/expat/dist/tests/dummy_cxx.cpp     delete
	external/mit/expat/dist/tests/handlers_cxx.cpp  delete
	external/mit/expat/dist/tests/memcheck_cxx.cpp  delete
	external/mit/expat/dist/tests/minicheck_cxx.cpp delete
	external/mit/expat/dist/tests/misc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/ns_tests_cxx.cpp  delete
	external/mit/expat/dist/tests/nsalloc_tests_cxx.cpp delete
	external/mit/expat/dist/tests/runtests_cxx.cpp  delete
	external/mit/expat/dist/tests/structdata_cxx.cpp delete
	external/mit/expat/dist/xmlwf/Makefile.in       delete
	external/mit/expat/dist/CMake.README            up to 1.1.1.9
	external/mit/expat/dist/CMakeLists.txt          up to 1.1.1.9
	external/mit/expat/dist/Changes                 up to 1.1.1.10
	external/mit/expat/dist/ConfigureChecks.cmake   up to 1.1.1.5
	external/mit/expat/dist/Makefile.am             up to 1.1.1.5
	external/mit/expat/dist/README.md               up to 1.1.1.5
	external/mit/expat/dist/configure.ac            up to 1.1.1.8
	external/mit/expat/dist/expat_config.h.cmake    up to 1.1.1.4
	external/mit/expat/dist/fix-xmltest-log.sh      up to 1.1.1.4
	external/mit/expat/dist/doc/reference.html      up to 1.1.1.9
	external/mit/expat/dist/doc/xmlwf.xml           up to 1.1.1.6
	external/mit/expat/dist/examples/element_declarations.c up to 1.1.1.2
	external/mit/expat/dist/fuzz/xml_lpm_fuzzer.cpp up to 1.1.1.2
	external/mit/expat/dist/fuzz/xml_parse_fuzzer.c up to 1.1.1.3
	external/mit/expat/dist/fuzz/xml_parsebuffer_fuzzer.c up to 1.1.1.3
	external/mit/expat/dist/lib/Makefile.am         up to 1.1.1.4
	external/mit/expat/dist/lib/expat.h             up to 1.1.1.10
	external/mit/expat/dist/lib/expat_external.h    up to 1.1.1.6
	external/mit/expat/dist/lib/internal.h          up to 1.1.1.7
	external/mit/expat/dist/lib/libexpat.def.cmake  up to 1.1.1.2
	external/mit/expat/dist/lib/xmlparse.c          up to 1.12
	external/mit/expat/dist/lib/xmlrole.c           up to 1.1.1.8
	external/mit/expat/dist/lib/xmlrole.h           up to 1.1.1.5
	external/mit/expat/dist/lib/xmltok.c            up to 1.8
	external/mit/expat/dist/lib/xmltok.h            up to 1.6
	external/mit/expat/dist/lib/xmltok_ns.c         up to 1.1.1.4
	external/mit/expat/dist/tests/Makefile.am       up to 1.1.1.4
	external/mit/expat/dist/tests/alloc_tests.c     up to 1.1.1.2
	external/mit/expat/dist/tests/basic_tests.c     up to 1.1.1.2
	external/mit/expat/dist/tests/common.c          up to 1.1.1.3
	external/mit/expat/dist/tests/handlers.c        up to 1.1.1.2
	external/mit/expat/dist/tests/handlers.h        up to 1.1.1.2
	external/mit/expat/dist/tests/memcheck.c        up to 1.1.1.5
	external/mit/expat/dist/tests/minicheck.c       up to 1.1.1.7
	external/mit/expat/dist/tests/minicheck.h       up to 1.1.1.8
	external/mit/expat/dist/tests/misc_tests.c      up to 1.1.1.3
	external/mit/expat/dist/tests/nsalloc_tests.c   up to 1.1.1.2
	external/mit/expat/dist/tests/structdata.c      up to 1.1.1.4
	external/mit/expat/dist/tests/xmltest.sh        up to 1.7
	external/mit/expat/dist/win32/README.txt        up to 1.1.1.7
	external/mit/expat/dist/win32/build_expat_iss.bat up to 1.1.1.4
	external/mit/expat/dist/win32/expat.iss         up to 1.1.1.10
	external/mit/expat/dist/xmlwf/unixfilemap.c     up to 1.1.1.6
	external/mit/expat/dist/xmlwf/xmlfile.c         up to 1.1.1.7
	external/mit/expat/dist/xmlwf/xmlwf.c           up to 1.1.1.9
	external/mit/expat/dist/xmlwf/xmlwf_helpgen.py  up to 1.1.1.4


Import expat 2.8.1 as expat-2-8-1
Merge expat 2.8.1
@
text
@@


1.1.1.2.2.1
log
@file install-sh was added on branch yamt-pagecache on 2012-04-17 00:04:41 +0000
@
text
@d1 520
@


1.1.1.2.2.2
log
@sync with head
@
text
@a0 520
#!/bin/sh
# install - install a program, script, or datafile

scriptversion=2009-04-28.21; # UTC

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.

nl='
'
IFS=" ""	$nl"

# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.

chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'

posix_mkdir=

# Desired mode of installed file.
mode=0755

chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=

src=
dst=
dir_arg=
dst_arg=

copy_on_change=false
no_target_directory=

usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
     --help     display this help and exit.
     --version  display version info and exit.

  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"

while test $# -ne 0; do
  case $1 in
    -c) ;;

    -C) copy_on_change=true;;

    -d) dir_arg=true;;

    -g) chgrpcmd="$chgrpprog $2"
	shift;;

    --help) echo "$usage"; exit $?;;

    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;

    -o) chowncmd="$chownprog $2"
	shift;;

    -s) stripcmd=$stripprog;;

    -t) dst_arg=$2
	shift;;

    -T) no_target_directory=true;;

    --version) echo "$0 $scriptversion"; exit $?;;

    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;

    *)  break;;
  esac
  shift
done

if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@@ is not empty: it contains at least $arg.
      set fnord "$@@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
  done
fi

if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
    exit 1
  fi
  # It's OK to call `install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
fi

if test -z "$dir_arg"; then
  trap '(exit $?); exit' 1 2 13 15

  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
fi

for src
do
  # Protect names starting with `-'.
  case $src in
    -*) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
  else

    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
      exit 1
    fi

    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
      exit 1
    fi

    dst=$dst_arg
    # Protect names starting with `-'.
    case $dst in
      -*) dst=./$dst;;
    esac

    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `

      test -d "$dstdir"
      dstdir_status=$?
    fi
  fi

  obsolete_mkdir_used=false

  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi

	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
	    then
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writeable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
	      fi
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
	    fi
	    trap '' 0;;
	esac;;
    esac

    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	-*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test -z "$d" && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
	else
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
	  fi
	fi
	prefix=$prefix/
      done

      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_

    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0

    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&

    # and set any options; do chmod last to preserve setuid bits.
    #
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1

    trap '' 0
  fi
done

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
@


