2019-12-30 12:24:38 +08:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
|
|
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
|
|
|
|
|
# Description: This shell script is used to apply patches for the project
|
|
|
|
|
# Author: zhangyu235@huawei.com
|
|
|
|
|
# Create: 2019-05-17
|
|
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
2020-09-14 14:58:02 +08:00
|
|
|
pkg=v1.2.0
|
2019-12-30 12:24:38 +08:00
|
|
|
cwd=$PWD
|
|
|
|
|
src=$cwd/$pkg
|
|
|
|
|
|
|
|
|
|
unzip $pkg.zip
|
2020-06-09 23:39:19 -04:00
|
|
|
if [[ ! -d patch ]]; then
|
|
|
|
|
tar zxf patch.tar.gz
|
|
|
|
|
fi
|
2019-12-30 12:24:38 +08:00
|
|
|
|
|
|
|
|
cd $src
|
|
|
|
|
git init
|
|
|
|
|
git add .
|
|
|
|
|
git config user.name 'build'
|
|
|
|
|
git config user.email 'build@obs.com'
|
|
|
|
|
git commit -m 'init build'
|
|
|
|
|
cd $cwd
|
|
|
|
|
|
|
|
|
|
series=$cwd/series.conf
|
|
|
|
|
while IPF= read -r line
|
|
|
|
|
do
|
|
|
|
|
if [[ "$line" =~ ^patch* ]]; then
|
|
|
|
|
echo git apply $cwd/$line
|
|
|
|
|
cd $src && git apply $cwd/$line
|
|
|
|
|
fi
|
|
|
|
|
done <"$series"
|
|
|
|
|
|
|
|
|
|
cd $cwd
|
|
|
|
|
cp -rf $src/* .
|
|
|
|
|
mv $src/.git $src/git
|
|
|
|
|
rm -rf containerd-1.2.0
|