tbootstrap/tbootstrap.sh

59 lines
881 B
Bash
Executable file

#!/bin/bash
filelist=`cat tbootstrap/stage0.txt`
function install()
{
for pkgname in $filelist; do
rpm --nodeps -i $pkgname/RPMS/x86_64/*.rpm --root=$HOME/newroot
done
cd /root/newroot
ln -s usr/bin bin
ln -s usr/lib lib
ln -s usr/lib64 lib64
cd usr/bin
ln -s bash sh
}
function fetch()
{
for pkgname in $filelist; do
if [ -d $pkgname ]; then
git -C $pkgname pull
else
mkdir $pkgname
git clone git@gitlab.tlnx.ru:rpms/$pkgname.git $pkgname
fi
done
}
function build()
{
for pkgname in $filelist; do
tlnxbuild/tlnxbuild.sh $pkgname || exit 1
done
}
function wipe()
{
for pkgname in $filelist; do
rm -fr $pkgname || exit 1
done
}
case $1 in
"install")
install
;;
"fetch")
fetch
;;
"build")
build
;;
"wipe")
wipe
;;
*)
echo Unknown command
;;
esac