diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-04-24 19:42:19 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-04-24 19:42:19 -0400 |
commit | f0ad4bdf7ea3e7b3ac2c64d27a57a9bbf4f693c9 (patch) | |
tree | 9293365a2551dd3fec50b212eeff7a2810ebea28 /.local/bin | |
parent | dcfbc06f2fcabc13d129931e3e9623fea7983ea1 (diff) |
Update: modern dbscripts mandates chroot building
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/autobuild.sh | 17 |
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 |