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 orbea
GregT GregT
Yaroslav Shmelev Yaroslav Shmelev
smallid

View File

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

View File

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