1 Star 0 Fork 0

Funtoo Linux/portage-gentoo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
make.conf.example-repatch.sh 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
die() {
echo "ERROR: $*" > /dev/stderr
patch -p0 make.conf.example < make.conf.example.diff
exit 1
}
if [[ ! -f make.conf.example || ! -f make.conf.example.x86.diff || ! -d ../.git ]]; then
echo "ERROR: current directory is invalid" > /dev/stderr
exit 1
fi
git diff --no-prefix --relative="$(basename "$(pwd)")" make.conf.example > make.conf.example.diff
git checkout -- make.conf.example
archs=()
for x in make.conf.example.*.diff; do
archs+=("$(basename ${x:18} .diff)")
done
for arch in "${archs[@]}"; do
echo "* Patching ${arch}"
cp make.conf.example make.conf.example.${arch} || die "copy failed"
patch -p0 make.conf.example.${arch} < make.conf.example.${arch}.diff > /dev/null || die "arch-patch failed"
patch -p0 make.conf.example.${arch} < make.conf.example.diff > /dev/null || die "patch failed"
done
echo "* Re-patching make.conf.example"
patch -p0 make.conf.example < make.conf.example.diff > /dev/null || die "repatch failed"
for arch in "${archs[@]}"; do
echo "* Creating diff for ${arch}"
diff -u make.conf.example make.conf.example.${arch} > make.conf.example.${arch}.diff
[[ -z ${KEEP_ARCH_MAKE_CONF_EXAMPLE} ]] && rm -f make.conf.example.${arch} make.conf.example.${arch}.orig
done
rm make.conf.example.diff
echo "Done"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/funtoo/portage-gentoo.git
git@gitee.com:funtoo/portage-gentoo.git
funtoo
portage-gentoo
portage-gentoo
master

搜索帮助