From f0ad4bdf7ea3e7b3ac2c64d27a57a9bbf4f693c9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 24 Apr 2017 19:42:19 -0400 Subject: Update: modern dbscripts mandates chroot building --- .local/bin/autobuild.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to '.local') 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 +# Copyright (C) 2014, 2016-2017 Luke Shumaker # # 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 -- cgit v1.2.3