rustit/mirror_runit/runit-2.1.2/package/compile
2024-03-24 23:51:57 +00:00

27 lines
671 B
Bash
Executable file

#!/bin/sh
set -e
umask 022
test -d package || sh -cx '! : Wrong working directory.'
test -d src || sh -cx '! : Wrong working directory.'
here=`env - PATH=$PATH pwd`
mkdir -p compile command
test -r compile/home || echo $here >compile/home
test -h compile/src || ln -s $here/src compile/src
echo 'Linking ./src/* into ./compile...'
for i in `ls src`; do
test -h compile/$i || ln -s src/$i compile/$i
done
echo 'Compiling everything in ./compile...'
sh -cxe 'cd compile; exec make'
echo 'Copying commands into ./command...'
for i in `cat package/commands`; do
rm -f command/$i'{new}'
cp -p compile/$i command/$i'{new}'
mv -f command/$i'{new}' command/$i
done