iglu: remove files, iglupkg: configurable paths
This commit is contained in:
parent
63edae20e5
commit
2d89d5c376
2 changed files with 34 additions and 15 deletions
2
iglu.sh
2
iglu.sh
|
@ -41,6 +41,8 @@ remove() {
|
||||||
while shift 2> /dev/null; do
|
while shift 2> /dev/null; do
|
||||||
if [ -d "/$1" ]; then
|
if [ -d "/$1" ]; then
|
||||||
rmdir "/$1" 2> /dev/null
|
rmdir "/$1" 2> /dev/null
|
||||||
|
elif [ -f "/$1" ]; then
|
||||||
|
rm -f "/$1" 2> /dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
set -e
|
set -e
|
||||||
|
|
47
iglupkg.sh
47
iglupkg.sh
|
@ -4,8 +4,21 @@ set -e
|
||||||
export HOST_ARCH=$(uname -m)
|
export HOST_ARCH=$(uname -m)
|
||||||
export HOST_TRIPLE="$HOST_ARCH-unknown-linux-musl"
|
export HOST_TRIPLE="$HOST_ARCH-unknown-linux-musl"
|
||||||
|
|
||||||
to_run=
|
usage() {
|
||||||
|
echo "usage: $(basename $0) [fbp]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal() {
|
||||||
|
echo "ERROR: $@"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
warn() {
|
||||||
|
echo "WARNING: $@"
|
||||||
|
}
|
||||||
|
|
||||||
|
to_run=
|
||||||
while [ ! -z "$1" ]; do
|
while [ ! -z "$1" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--with-cross=*)
|
--with-cross=*)
|
||||||
|
@ -17,10 +30,25 @@ while [ ! -z "$1" ]; do
|
||||||
--with-cross)
|
--with-cross)
|
||||||
fatal '--with-cross=<arch> requires an argument'
|
fatal '--with-cross=<arch> requires an argument'
|
||||||
;;
|
;;
|
||||||
|
--with-cross-dir=*)
|
||||||
|
WITH_CROSS_DIR=$(echo "$1" | cut -d'=' -f2)
|
||||||
|
[ -z "$WITH_CROSS_DIR" ] && fatal '--with-cross-dir=<sysroot> requires an argument'
|
||||||
|
[ -d "$WITH_CROSS_DIR" ] 2>/dev/null || warn "$WITH_CROSS_DIR does not exist"
|
||||||
|
;;
|
||||||
|
--with-cross-dir)
|
||||||
|
fatal '--with-cross-dir=<sysroot> requires an argument'
|
||||||
|
;;
|
||||||
--for-cross)
|
--for-cross)
|
||||||
echo 'INFO: for cross'
|
echo 'INFO: for cross'
|
||||||
FOR_CROSS=1
|
FOR_CROSS=1
|
||||||
;;
|
;;
|
||||||
|
--for-cross-dir=*)
|
||||||
|
FOR_CROSS_DIR=$(echo "$1" | cut -d'=' -f2)
|
||||||
|
[ -z "$FOR_CROSS_DIR" ] && fatal '--for-cross-dir=<sysroot> requires an argument'
|
||||||
|
;;
|
||||||
|
--for-cross-dir)
|
||||||
|
fatal '--for-cross-dir=<sysroot> requires an argument'
|
||||||
|
;;
|
||||||
fbp)
|
fbp)
|
||||||
to_run="f b p"
|
to_run="f b p"
|
||||||
;;
|
;;
|
||||||
|
@ -46,6 +74,9 @@ while [ ! -z "$1" ]; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[ -z "$WITH_CROSS_DIR" ] && WITH_CROSS_DIR=/usr/$ARCH-linux-musl
|
||||||
|
[ -z "$FOR_CROSS_DIR" ] && FOR_CROSS_DIR=/usr/$ARCH-linux-musl
|
||||||
|
|
||||||
if [ -z "$ARCH" ]; then
|
if [ -z "$ARCH" ]; then
|
||||||
export ARCH=$HOST_ARCH
|
export ARCH=$HOST_ARCH
|
||||||
fi
|
fi
|
||||||
|
@ -63,20 +94,6 @@ export CXXFLAGS=$CFLAGS
|
||||||
|
|
||||||
export JOBS=$(nproc)
|
export JOBS=$(nproc)
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo "usage: $(basename $0) [fbp]"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
fatal() {
|
|
||||||
echo "ERROR: $@"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
warn() {
|
|
||||||
echo "WARNING: $@"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -f build.sh ] || fatal 'build.sh not found'
|
[ -f build.sh ] || fatal 'build.sh not found'
|
||||||
|
|
||||||
. ./build.sh
|
. ./build.sh
|
||||||
|
|
Loading…
Reference in a new issue