docker/apply-patches
2022-11-24 11:46:52 +08:00

50 lines
1.0 KiB
Bash
Executable File

#!/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: jingrui@huawei.com
# Create: 2019-03-02
set -ex
pkg=docker-ce-18.09.0
cwd=$PWD
src=$cwd/$pkg
tar -xzvf v18.09.0.tar.gz
if [ ! -d patch ];then
tar -xzf patch.tar.gz
fi
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
if [ "$1" == "selinux" ]; then
cp -rf $src/components/engine/contrib/selinux-euleros/docker-engine-selinux/* .
else
cp -rf $src/* .
cp -rf VERSION-vendor $cwd/components/cli/
cp -rf VERSION-vendor $cwd/components/engine/
cp -rf git-commit $cwd/components/cli/
cp -rf git-commit $cwd/components/engine/
fi
mv $src/.git $src/git