Add better non-interactive/cron run support

Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
smallid 2019-03-12 19:56:02 -07:00 committed by Willy Sudiarto Raharjo
parent b00019e28d
commit a102d63b53
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
3 changed files with 13 additions and 3 deletions

View File

@ -96,3 +96,4 @@ We moved to github, so revision number no longer used
orbea
GregT
Yaroslav Shmelev
smallid

View File

@ -175,7 +175,7 @@ EOF
load_repositories || exit 1
# Check for ncurses
[[ -x /usr/bin/tput ]] && HAS_NCURSES=1
[[ -n $interactive ]] && [[ -x /usr/bin/tput ]] && HAS_NCURSES=1
}
yesno_to_setunset() {
@ -771,7 +771,7 @@ check_for_updates() {
for CURPKG in $PKGS; do
# Bail out if the user pressed ESC
progressbar_interrupted && touch $PROGRESSBAR_INTERRUPTED && break
[[ -n $interactive ]] && progressbar_interrupted && touch $PROGRESSBAR_INTERRUPTED && break
# split CURPKG into its components
split_pkg_name $CURPKG
@ -4613,6 +4613,13 @@ if [[ $(id -u) != 0 ]]; then
exit 1
fi
# Check if we are interactive.
if [ -t 0 ]; then
interactive=1
else
non_interactive=1
fi
# Set up ARCH - borrowed from SBo SlackBuild template
# Automatically determine the architecture we're building on:
if [[ -z "$ARCH" ]]; then

View File

@ -1,6 +1,6 @@
SBOPKG NEWS
sbopkg-dev (2018-09-01 23:00:08 UTC)
sbopkg-dev (2019-03-15 14:24:30 UTC)
FEATURES
* sqg: Parallelize building of single and all packages by option -j.
Patch by Marcel Saegebarth.
@ -26,6 +26,8 @@ sbopkg-dev (2018-09-01 23:00:08 UTC)
Initial patch by Orbea (#49).
* sbopkg: Add logrotate support.
Feature Request by wronguser (#50).
* sbokg: Add better non-interactive/cron run support
Initial patch by smallid (#56).
MODIFICATIONS
* bash-completion: Complete -i and -b when git repo is used