aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-07 00:11:06 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-07 00:11:06 +0530
commit12defd2e9e53e132336583fd54dd16d00fbabe2a (patch)
tree14199fed4ddf3b779fa766cd5da413b0d29d1731
parentInitialise some basic variables: ATOMS, P, PN, PV (diff)
downloadautotua-12defd2e9e53e132336583fd54dd16d00fbabe2a.tar.gz
autotua-12defd2e9e53e132336583fd54dd16d00fbabe2a.tar.bz2
autotua-12defd2e9e53e132336583fd54dd16d00fbabe2a.zip
- Implement post() and emerge()
- Document a few functions in jobuild-functions.sh
-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=${@}