summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/autobuild.sh29
1 files changed, 16 insertions, 13 deletions
diff --git a/bin/autobuild.sh b/bin/autobuild.sh
index fdcfb3d..eeeaae8 100755
--- a/bin/autobuild.sh
+++ b/bin/autobuild.sh
@@ -33,13 +33,18 @@ main() {
# merge could easily break things if we get the git time.
newpkgver_date=$(LC_ALL=C date -u +%Y%m%d)
- # Confirm that we are in a valid directory, and lock it.
- if [[ $PWD != *.git ]]; then
- die "%q should be run as a hook from a git repository" "$0"
- fi
- lock 9 "$PWD/autobuild.lock" "Waiting for previous run of %q to finish" "$0"
+ # Configuration parsing ################################################
+
+ . "$(librelib conf)"
+ load_files libretools
+ check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND
+
+ # Lock to pevent conflicting runs ######################################
+
+ mkdir -p "${WORKDIR}/lockdir"
+ lock 9 "$HOME/packages/lockdir/${PWD//\//%2F}" "Waiting for previous run of %q to finish" "$0"
- # Option parsing ###############################################################
+ # Option/usage parsing #################################################
if [[ $# -lt 1 ]]; then
error "%q takes at least 1 argument" "$0"
@@ -56,15 +61,13 @@ main() {
fi
unset package_re
- newgitver=$(git log -n1 --format='%H' master -- "${@:2}")
-
- # Configuration parsing ########################################################
+ if [[ $PWD != *.git ]]; then
+ die "%q should be run as a hook from a git repository" "$0"
+ fi
- . "$(librelib conf)"
- load_files libretools
- check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND
+ newgitver=$(git log -n1 --format='%H' master -- "${@:2}")
- # The real work begins! ########################################################
+ # The real work begins! ################################################
# Get the ABSLibre tree
gitget -f -p "$ABSLIBRESEND" checkout "$ABSLIBRERECV" "$WORKDIR/abslibre"