aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slave/autotua/bin/jobuild-functions.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/slave/autotua/bin/jobuild-functions.sh b/slave/autotua/bin/jobuild-functions.sh
index 5dd2749..7fa235f 100644
--- a/slave/autotua/bin/jobuild-functions.sh
+++ b/slave/autotua/bin/jobuild-functions.sh
@@ -21,17 +21,59 @@ jvars() {
PV=${P##*-}
}
+# Default function to generate a list of ATOMS to be used by the jobuild
+# Should be overridden in the jobuild if required
atoms() {
local temp
temp="${jobuild%/*}/conf/${P}.atoms"
[ -f "${temp}" ] && ATOMS=$(<"${temp}")
}
+# Initialize some basic jobuild env variables
initialize() {
jvars
atoms
}
+# POST ${2}=${3} to ${1}
+# Usage: post ${where} ${key} ${data}
+# Result is stored in ${POST}
+post() {
+ POST=$(wget "${1}"?"${2}"=${3} -O -)
+}
+
+# Wrapper for package managers
+emerge() {
+ case "${PMAN}"in
+ emerge)
+ local CMD="/usr/bin/emerge --verbose --newuse --deep"
+ case ${1} in
+ build)
+ ${CMD} ${ATOMS}
+ ;;
+ build-binpkgs)
+ ${CMD} --buildpkg ${ATOMS}
+ ;;
+ use-binpkgs)
+ ${CMD} --usepkg --getbinpkg ${ATOMS}
+ ;;
+ *)
+ die "Unsupported merge action ${1}"
+ ;;
+ esac
+ ;;
+ pmerge)
+ die "pkgcore support not yet implemented"
+ ;;
+ paludis)
+ die "paludis support not yet implemented"
+ ;;
+ *)
+ ${PMAN} || die "Running custom package manager command ${PMAN} failed"
+ ;;
+ esac
+}
+
has() {
local this=${1}; shift
local those=${@}