[repo] add post-merge hook used in chroots
This commit is contained in:
parent
a6bbe1b74e
commit
580627b97b
37
git-hooks/post-merge
Executable file
37
git-hooks/post-merge
Executable file
@ -0,0 +1,37 @@
|
||||
# although it doesn't seem to be documented,
|
||||
# current directory appears to be git "main" dir
|
||||
|
||||
echo "post-merge hook is executing"
|
||||
|
||||
arch="$(uname -m)"
|
||||
src_make_conf=""
|
||||
src_make_conf_common=""
|
||||
case $arch in
|
||||
i686)
|
||||
src_make_conf="./conf/intel/portage/make.conf.x86"
|
||||
;;
|
||||
x86_64)
|
||||
src_make_conf="./conf/intel/portage/make.conf.amd64"
|
||||
;;
|
||||
arm*)
|
||||
if [ -e "/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi" ]; then
|
||||
src_make_conf="./conf/armv7l/portage/make.conf.hardfp"
|
||||
src_make_conf_common="./conf/armv7l/portage/make.conf.common"
|
||||
elif [ -e "/usr/lib/gcc/armv7a-unknown-linux-gnueabi" ]; then
|
||||
src_make_conf="./conf/armv7l/portage/make.conf.softfp"
|
||||
src_make_conf_common="./conf/armv7l/portage/make.conf.common"
|
||||
else
|
||||
echo "UNSUPPORTED ARM ABI, CANNOT COPY make.conf !!!"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$src_make_conf" ]; then
|
||||
echo "Can't execute post-merge hook. Unknown arch \"$arch\"." >&2
|
||||
else
|
||||
echo "post-merge hook: copying make.conf (from $src_make_conf):"
|
||||
cp --no-target-directory -v "$src_make_conf" /etc/make.conf
|
||||
if [ -n "$src_make_conf_common" ]; then
|
||||
cp --no-target-directory -v "$src_make_conf_common" "/etc/$(basename $src_make_conf_common)"
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user