2019-08-10 17:57:26 +02:00
|
|
|
#!/usr/bin/env bash
|
2014-01-24 18:58:30 +01:00
|
|
|
############################################################################
|
2020-01-23 00:26:27 +01:00
|
|
|
# boards/z16/z16f/z16f2800100zcog/tools/dopatch.sh
|
2014-01-24 18:58:30 +01:00
|
|
|
#
|
2021-03-16 16:20:49 +01:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
2014-01-24 18:58:30 +01:00
|
|
|
#
|
2021-03-16 16:20:49 +01:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2014-01-24 18:58:30 +01:00
|
|
|
#
|
2021-03-16 16:20:49 +01:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2014-01-24 18:58:30 +01:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
2014-04-24 23:55:53 +02:00
|
|
|
USAGE="${0} [-R] \$PWD"
|
2014-01-24 18:58:30 +01:00
|
|
|
WD=`pwd`
|
2019-08-05 14:04:14 +02:00
|
|
|
TOOLDIR=${WD}/boards/z16f2800100zcog/tools
|
2014-01-24 18:58:30 +01:00
|
|
|
ME=${TOOLDIR}/dopatch.sh
|
|
|
|
PATCH=${TOOLDIR}/zneo-zdsii-5_0_1-variadic-func-fix.patch
|
2014-04-24 23:55:53 +02:00
|
|
|
ARGS=${1}
|
2014-01-24 18:58:30 +01:00
|
|
|
|
|
|
|
if [ ! -x ${ME} ]; then
|
|
|
|
echo "ERROR: This script must be executed from the top-level NuttX directory"
|
|
|
|
echo ${USAGE}
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -r ${PATCH} ]; then
|
|
|
|
echo "ERROR: Readable patch not found at ${PATCH}"
|
|
|
|
echo ${USAGE}
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd .. || \
|
|
|
|
{ echo "ERROR: failed to CD to the parent directory"; exit 1; }
|
|
|
|
|
2014-04-24 23:55:53 +02:00
|
|
|
cat ${PATCH} | patch ${ARGS} -p1 || \
|
2014-01-24 18:58:30 +01:00
|
|
|
{ echo "ERROR: patch failed" ; exit 1; }
|