freebsd-nq/build/ci_build.sh
Martin Matuska 91360634ec Update vendor/libarchive to git d77b577b2d5aa259fca06313c4940e1e61ab1e0e
Vendor changes (relevant to FreeBSD):
- bugfixes, improvemens and optimizations in ACL code
- NFSv4 ACLs can now be extracted from Solaris tar archives

Security fixes:
- cab reader: endless loop when parsing MSZIP signature (OSS-Fuzz 335)
- LHA reader: heap-buffer-overflow in lha_read_file_header_1() (CVE-2017-5601)
- LZ4 reader: null-pointer dereference in lz4_filter_read_legacy_stream()
  (OSS-Fuzz 453)
- mtree reader: heap-buffer-overflow in detect_form() (OSS-Fuzz 421, 443)
- WARC reader: heap-buffer-overflow in xstrpisotime() (OSS-Fuzz 382, 458)

Memory leak fixes:
- ACL support: free memory allocated by acl_get_qualifier()
- disk writer: missing free in create_filesystem_object()
- file reader: fd leak (Coverity 1016755)
- gnutar writer: fix free in archive_write_gnutar_header() (Coverity 1016752)
- iso 9660 reader: missing free in parse_file_info() (part. Coverity 1016754)
- program reader: missing free in __archive_read_program()
- program writer: missing free in __archive_write_program_free()
- xar reader: missing free in xar_cleanup()
- xar reader: missing frees in expat_xmlattr_setup() (Coverity 1229979-1229981)
- xar writer: missing free in file_free()
- zip reader: missing free in zip_read_locazip_read_local_file_header()
2017-02-02 00:20:18 +00:00

110 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
#
# Automated build and test of libarchive on CI systems
#
# Variables that can be passed via environment:
# BUILD_SYSTEM=
# BUILDDIR=
# SRCDIR=
# CONFIGURE_ARGS=
# MAKE_ARGS=
#
ACTIONS=
BUILD_SYSTEM="${BUILD_SYSTEM:-autotools}"
MAKE="${MAKE:-make}"
CMAKE="${CMAKE:-cmake}"
CURDIR=`pwd`
SRCDIR="${SRCDIR:-`pwd`}"
RET=0
usage () {
echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test ] [ -a ... ] [ -d builddir ] [-s srcdir ]"
}
inputerror () {
echo $1
usage
exit 1
}
while getopts a:b:d:s: opt; do
case ${opt} in
a)
case "${OPTARG}" in
autogen) ;;
configure) ;;
build) ;;
test) ;;
*) inputerror "Invalid action (-a)" ;;
esac
ACTIONS="${ACTIONS} ${OPTARG}"
;;
b) BUILD_SYSTEM="${OPTARG}"
case "${BUILD_SYSTEM}" in
autotools) ;;
cmake) ;;
*) inputerror "Invalid build system (-b)" ;;
esac
;;
d)
BUILDDIR="${OPTARG}"
;;
s)
SRCDIR="${OPTARG}"
if [ ! -f "${SRCDIR}/build/version" ]; then
inputerror "Missing file: ${SRCDIR}/build/version"
fi
;;
esac
done
if [ -z "${ACTIONS}" ]; then
ACTIONS="autogen configure build test"
fi
if [ -z "${BUILD_SYSTEM}" ]; then
inputerror "Missing type (-t) parameter"
fi
if [ -z "${BUILDDIR}" ]; then
BUILDDIR="${CURDIR}/build_ci/${BUILD_SYSTEM}"
fi
mkdir -p "${BUILDDIR}"
for action in ${ACTIONS}; do
cd "${BUILDDIR}"
case "${action}" in
autogen)
case "${BUILD_SYSTEM}" in
autotools)
cd "${SRCDIR}"
sh build/autogen.sh
RET="$?"
;;
esac
;;
configure)
case "${BUILD_SYSTEM}" in
autotools) "${SRCDIR}/configure" ${CONFIGURE_ARGS} ;;
cmake) ${CMAKE} ${CONFIGURE_ARGS} "${SRCDIR}" ;;
esac
RET="$?"
;;
build)
${MAKE} ${MAKE_ARGS}
RET="$?"
;;
test)
case "${BUILD_SYSTEM}" in
autotools)
${MAKE} ${MAKE_ARGS} check LOG_DRIVER="${SRCDIR}/build/ci_test_driver"
;;
cmake)
${MAKE} ${MAKE_ARGS} test
;;
esac
RET="$?"
;;
esac
if [ "${RET}" != "0" ]; then
exit "${RET}"
fi
cd "${CURDIR}"
done
exit "${RET}"