summaryrefslogtreecommitdiff
path: root/.local/bin/autobuild.sh
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/autobuild.sh')
-rwxr-xr-x.local/bin/autobuild.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/.local/bin/autobuild.sh b/.local/bin/autobuild.sh
index 009cbf7..c5a9bad 100755
--- a/.local/bin/autobuild.sh
+++ b/.local/bin/autobuild.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2014 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright (C) 2014, 2016-2017 Luke Shumaker <lukeshu@sbcglobal.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,6 +16,11 @@
export PATH # because of setuid safety, path may be currently un-exported
+withtty() {
+ local cmd
+ printf -v cmd '%q ' "$@"
+ script --return --quiet --command "$cmd" /dev/null
+}
usage() {
print "Usage: %q REPO/PKGBASE [FILES...]" "${0##*/}"
@@ -51,7 +56,7 @@ main() {
if [[ $# -lt 1 ]]; then
error "%q takes at least 1 argument" "$0"
usage >&2
- exit 1
+ return 1
fi
package=$1
@@ -59,7 +64,7 @@ main() {
if ! [[ $package =~ $package_re ]]; then
error "The first argument must be in the format REPO/PKGBASE: %s" "$package"
usage >&2
- exit 1
+ return 1
fi
unset package_re
@@ -87,7 +92,7 @@ main() {
# Make sure we actually have changes
if [[ "$newgitver" == "$oldgitver" ]]; then
msg 'No new changes were committed, nothing to do'
- exit 0
+ return 0
fi
# Handle doing multiple versions in the same day
@@ -108,7 +113,9 @@ main() {
git commit -m "Update ${package}"
# Build the new package
- makepkg -c
+ withtty sudo librechroot -n autobuilder -l root update
+ withtty sudo librechroot -n autobuilder sync
+ withtty sudo libremakepkg -n autobuilder
librestage
# Publish the updates