rubik/apply-patch
DCCooper 7895c8e70f rubik: add build folder for container image build
Signed-off-by: DCCooper <1866858@gmail.com>
(cherry picked from commit 4d19602e9c005b4f9f5ab38771d726d313e9a884)
2022-11-30 15:54:30 +08:00

33 lines
688 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
# Description: This shell script is used to apply patches for the project
# Author: rubik team
# Create: 2021-12-27
set -ex
pkg=rubik
cwd=$PWD
src=$cwd/$pkg
tar_file=v"$(awk -F"-" '{print $1}' < VERSION-vendor)".tar.gz
mkdir ${src} && tar -zxvf "${tar_file}" -C ${src} --strip-components 1
if [ ! -d patch ]; then
tar -zxvf patch.tar.gz
fi
series=$cwd/series.conf
while IPF= read -r line
do
if [[ "$line" =~ ^patch* ]]; then
echo patch -p1 $cwd/$line
cd $src && patch -p1 < $cwd/$line
fi
done <"$series"
cd $cwd
cp -rf $src/* .
cp -f VERSION-vendor VERSION
rm -rf $src