This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
ab3.sh
executable file
·65 lines (55 loc) · 2.17 KB
/
ab3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# ab3.sh: the starting point
##@copyright GPL-2.0+
# Basic environment declarations
export ABVERSION=3
export ABSET=/etc/autobuild
if [ ! "$AB" ]; then
export AB=$(cat "$ABSET/prefix" || dirname "$(readlink -e "$0")")
fi
export ABBLPREFIX=$AB/lib
export ABBUILD ABHOST ABTARGET
# compat 1.x and fallback
: "${ABBUILD=$ARCH}" "${ABHOST=${CROSS:-$ABBUILD}}" "${ABTARGET=$ABHOST}"
# For consistency of build output
export LANG=C.UTF-8
# Behavior
((AB_NOISY)) && set -xv
((AB_SELF)) && AB=$(dirname "$(readlink -e "$0")")
# Check and load base library
# TODO: split autobuild base libraries from the base libraries
# or the other way around.
. $AB/lib/diag.sh || { echo "\e[1;91m FATAL: Cannot open stacktrace printing library! exiting."; exit 1; }
. $AB/lib/base.sh || { echo "\e[1;91m FATAL: Cannot open base library! exiting."; exit 1; }
. $AB/lib/builtins.sh || { echo "\e[1;91m FATAL: Cannot open utility function library! exiting."; exit 1; }
autobuild-help(){
abinfo "Help Requested."
echo -e "\e[1mAutobuild ${ABVERSION:-3}\e[0m, the next generation of autobuild for AOSC OS,\nwith multiple package manager support.\nAutobuild 3 is Licensed under the GNU General Public License, version 2.\n
\e[1mBRIEF HELP:\tEnvironment variables\e[0m
\e[1mAB_NOISY\e[0m\tRuns \`set -xv' if set to a non-empty value.
\e[1mAB_SELF\e[0m\tBuilds autobuild itself in the source tree if set to a non-empty value.\n\t\tDefault if $ABSET/prefix doesn't exist.
\e[1mAB_DBG\e[0m\tPrints debug information to stderr if set to a non-empty value.\n\t\tNow it prints the files sourced.\n"
# Not implemented.
# . $AB/extended-help 2>/dev/null
abinfo "End of autobuild-core help."
abinfo "See GitHub wiki at AOSC-Dev/autobuild3 for information on usage and hacking."
}
autobuild-clean(){
rm -rf {abdist,*_*.tar.xz,*.deb,abscripts,abspec} &&
abinfo "Build directory clean."
}
autobuild-plugin(){
ab_dbg "Called plugin bootstrap.."
}
# Plugin and external command parser
if [ "$1" ]; then
PATH="$AB/contrib:$PATH" PLUG="$1"
shift
ab_dbg "Starting autobuild-$PLUG"
"autobuild-$PLUG" "$@"
_ret=$?
((!_ret)) || aberr "autobuild-$PLUG returned ${_ret}."
exit $_ret
fi
# RTFM: help source
recsr $AB/proc/*.sh