usr/src/cmd/bash/Solaris/apply_patches.sh
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
parent 0 b34509ac961f
permissions -rwxr-xr-x
Bash patch catchup including shellshock

#!/bin/bash
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)apply_patches.sh	1.1	09/10/05 SMI"

PATCHDB="patches.applied"
mkdir -p ${PATCHDB}

for file in \
    bash40-001 \
    bash40-002 \
    bash40-003 \
    bash40-004 \
    bash40-005 \
    bash40-006 \
    bash40-007 \
    bash40-008 \
    bash40-009 \
    bash40-010 \
    bash40-011 \
    bash40-012 \
    bash40-013 \
    bash40-014 \
    bash40-015 \
    bash40-016 \
    bash40-017 \
    bash40-018 \
    bash40-019 \
    bash40-020 \
    bash40-021 \
    bash40-022 \
    bash40-023 \
    bash40-024 \
    bash40-025 \
    bash40-026 \
    bash40-027 \
    bash40-028 \
    bash40-029 \
    bash40-030 \
    bash40-031 \
    bash40-032 \
    bash40-033 \
    bash40-034 \
    bash40-035 \
    bash40-036 \
    bash40-037 \
    bash40-038 \
    bash40-039 \
    bash40-040 \
    bash40-041 \
    bash40-042 \
    bash40-043 \
    bash40-044 \
    disable-function-imports
do
    if [ ! -f ${PATCHDB}/${file}.applied ] ; then
        echo "Applying upstream bash 4.0 patch ${file}."
        gpatch -p0 < ../Patches-4.0/${file} || exit 1
        touch ${PATCHDB}/${file}.applied
    else
        echo "Patch ${file} has already been applied."
    fi
done

for file in \
    config.h.in.0.diff \
    config-top.h.1.diff \
    Makefile.in.3.diff \
    glob.c.4.diff \
    snprintf.c.5.diff \
    variables.c.6.diff \
    signames.c.7.diff \
    rlprivate.h.8.diff \
    xmbsrtowcs.c.9.diff \
    configure.10.diff \
    input.c.11.diff \
    input_avail.c.12.diff \
    rlconf.h.13.diff \
    bashref.info.14.diff \
    bash.man.15.diff \
    rbash.man.16.diff
do
    if [ ! -f ${PATCHDB}/${file}.applied ] ; then
	echo "Applying Solaris patch ${file}."
	gpatch -p0 < ../Solaris/diffs/${file} || exit 1
	touch ${PATCHDB}/${file}.applied
    else
	echo "Patch ${file} has already been applied."
    fi
done

touch .patched

exit 0