From 2d1ae58285ade402260bf5d5a4dbf42aba027fc5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Apr 2017 16:39:29 -0400 Subject: Consistently use ". $(librelib slug)" to load libraries. --- src/abslibre-tools/createworkdir | 4 ++-- src/abslibre-tools/diff-unfree | 4 ++-- src/abslibre-tools/libreaddiff | 4 ++-- src/abslibre-tools/libredbdiff | 2 +- src/abslibre-tools/librerelease | 4 ++-- src/abslibre-tools/librestage | 4 ++-- src/aur | 4 ++-- src/dagpkg | 4 ++-- src/gitget/gitget | 2 +- src/gitget/libregit | 2 +- src/is_built | 2 +- src/lib/blacklist.sh | 2 +- src/lib/conf.sh.in | 9 ++++----- src/lib/librelib | 2 +- src/lib/librexgettext | 2 +- src/lib/messages.sh | 2 +- src/repo-diff | 2 +- src/toru/toru-info | 2 +- src/toru/toru-path | 4 ++-- src/toru/toru-where | 2 +- src/xbs-abs/helper-abs | 2 +- src/xbs-abslibre/helper-abslibre | 2 +- src/xbs/xbs | 2 +- 23 files changed, 34 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 5599de9..80b2d5e 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -25,8 +25,8 @@ set -euE -. libremessages -. "$(librelib conf.sh)" +. "$(librelib messages)" +. "$(librelib conf)" load_files libretools check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND # these are asked for by `xbs download` diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index 12c919f..15fd197 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -22,8 +22,8 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -. libremessages -. "$(librelib conf.sh)" +. "$(librelib messages)" +. "$(librelib conf)" load_files libretools check_vars libretools DIFFPROG || exit 1 diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index 8698920..afd1c98 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -21,8 +21,8 @@ set -e -. libremessages -. "$(librelib conf.sh)" +. "$(librelib messages)" +. "$(librelib conf)" load_files libretools check_vars libretools WORKDIR diff --git a/src/abslibre-tools/libredbdiff b/src/abslibre-tools/libredbdiff index 09c7ad1..54b386e 100755 --- a/src/abslibre-tools/libredbdiff +++ b/src/abslibre-tools/libredbdiff @@ -40,7 +40,7 @@ field_pkgname_parabola=30 field_pkgname_arch=30 -. libremessages +. "$(librelib messages)" cmd="${0##*/}" diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 2a3fba9..e7f8139 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -36,8 +36,8 @@ # create_signature() is taken from pacman:makepkg, which is GPLv2+, # so we take the '+' to combine it with our GPLv3+. -. libremessages -. "$(librelib conf.sh)" +. "$(librelib messages)" +. "$(librelib conf)" dryrun="" upload_only=false diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 39523ac..b8278d2 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -23,8 +23,8 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -. libremessages -. "$(librelib conf.sh)" +. "$(librelib messages)" +. "$(librelib conf)" usage() { print "Usage: %s [REPO]" "${0##*/}" diff --git a/src/aur b/src/aur index 49c79b9..84dc984 100755 --- a/src/aur +++ b/src/aur @@ -20,7 +20,7 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -. libremessages +. "$(librelib messages)" usage() { print "Usage: %s [-h] PKGNAME [PKGNAME2 PKGNAME3...]" "${0##*/}" @@ -45,7 +45,7 @@ main() { return 1 fi - . "$(librelib conf.sh)" + . "$(librelib conf)" load_files libretools check_vars libretools DIFFPROG || exit 1 diff --git a/src/dagpkg b/src/dagpkg index 1989b4d..a12bab5 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -22,8 +22,8 @@ # along with this program. If not, see . set -e -source libremessages -source "$(librelib conf)" +. "$(librelib messages)" +. "$(librelib conf)" # Source variables from libretools load_files libretools diff --git a/src/gitget/gitget b/src/gitget/gitget index c941441..15a4f1b 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" # from makepkg dir_is_empty() { diff --git a/src/gitget/libregit b/src/gitget/libregit index e45c3a8..6c49af5 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" usage() { print 'Usage: %s REPO REF DIR' "${0##*/}" diff --git a/src/is_built b/src/is_built index 29b2744..7e4a005 100755 --- a/src/is_built +++ b/src/is_built @@ -20,7 +20,7 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -. libremessages +. "$(librelib messages)" usage() { print "Usage: %s [-h] PKGNAME [PKGVER]" "${0##*/}" "${0##*/}" diff --git a/src/lib/blacklist.sh b/src/lib/blacklist.sh index 15366b8..9597bbc 100644 --- a/src/lib/blacklist.sh +++ b/src/lib/blacklist.sh @@ -42,7 +42,7 @@ blacklist-cat() { # Usage: blacklist-update # Updates (or creates) the cached copy of the blacklist. blacklist-update() ( - . libremessages + . "$(librelib messages)" load_files libretools || return 1 check_vars libretools BLACKLIST || return 1 diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in index 8394801..0b2275a 100644 --- a/src/lib/conf.sh.in +++ b/src/lib/conf.sh.in @@ -133,7 +133,7 @@ load_files() { # Check whether the variables listed are properly set. # If not, it prints a message saying to set them in the configuration file(s) # for $slug. -check_vars() ( +check_vars() { local slug=$1; shift local ret=0 @@ -141,12 +141,11 @@ check_vars() ( local VAR for VAR in "$@"; do if [[ -z ${!VAR:-} ]]; then - type print &>/dev/null || . libremessages if [[ $(list_files $slug|wc -l) -gt 1 ]]; then - _l print "Configure '%s' in one of:" "$VAR" + libremessages _l print "Configure '%s' in one of:" "$VAR" list_files $slug | sed 's/./ -> &/' else - _l print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)" + libremessages _l print "Configure '%s' in '%s'" "$VAR" "$(list_files "$slug")" fi ret=1 fi @@ -155,7 +154,7 @@ check_vars() ( if [[ $ret != 0 ]]; then return 1 fi -) +} # Usage: get_var # Does not work with arrays diff --git a/src/lib/librelib b/src/lib/librelib index e9d184e..fc03e32 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -47,7 +47,7 @@ prose() { cmd=${0##*/} usage() { - . libremessages + . libremessages # Don't change this to use librelib print 'Usage: . $(%s LIBRARY)' "$cmd" print 'Usage: %s -h' "$cmd" print "Finds a Bash library file" diff --git a/src/lib/librexgettext b/src/lib/librexgettext index db575d6..a4f2eb9 100755 --- a/src/lib/librexgettext +++ b/src/lib/librexgettext @@ -42,7 +42,7 @@ errusage() { } usage() { - . libremessages + . "$(librelib messages)" print 'Usage: %s [OPTIONS] FILES...' "${0##*/}" print 'Generates .pot files for programs using libremessages' echo diff --git a/src/lib/messages.sh b/src/lib/messages.sh index 0125003..e85590f 100644 --- a/src/lib/messages.sh +++ b/src/lib/messages.sh @@ -33,7 +33,7 @@ # Inherit most functions from devtools # ################################################################################ -. "$(librelib common.sh)" +. "$(librelib common)" ################################################################################ # Own functions # diff --git a/src/repo-diff b/src/repo-diff index d11732b..c875dce 100755 --- a/src/repo-diff +++ b/src/repo-diff @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" usage() { print "Usage: %s arch/core/i686 parabola/core/i686" "${0##*/}" diff --git a/src/toru/toru-info b/src/toru/toru-info index a7081cb..9bb80d3 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" . "$(librelib conf)" for _pkg in "$@"; do diff --git a/src/toru/toru-path b/src/toru/toru-path index 4600a5c..2c00bc7 100755 --- a/src/toru/toru-path +++ b/src/toru/toru-path @@ -20,7 +20,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" setup_traps # TODO: better option parsing @@ -28,7 +28,7 @@ TORUPATH=${T:-${TORUPATH}} VERBOSE=${V:-false} FORCE=${F:-false} -. "$(librelib conf.sh)" +. "$(librelib conf)" load_files libretools check_vars libretools TORUPATH REPOS || exit 1 load_files abs diff --git a/src/toru/toru-where b/src/toru/toru-where index f6df15f..14a40eb 100755 --- a/src/toru/toru-where +++ b/src/toru/toru-where @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. "$(librelib conf.sh)" +. "$(librelib conf)" load_files libretools check_vars libretools TORUPATH || exit 1 diff --git a/src/xbs-abs/helper-abs b/src/xbs-abs/helper-abs index d7e2499..85a7fca 100755 --- a/src/xbs-abs/helper-abs +++ b/src/xbs-abs/helper-abs @@ -32,7 +32,7 @@ # along with this program. If not, see . load_config() { - . "$(librelib conf.sh)" + . "$(librelib conf)" load_files xbs-abs # SVNUSER is optional check_vars xbs-abs SVNDIR SVNREPOS ARCHES || exit 1 diff --git a/src/xbs-abslibre/helper-abslibre b/src/xbs-abslibre/helper-abslibre index 91e7361..10da489 100755 --- a/src/xbs-abslibre/helper-abslibre +++ b/src/xbs-abslibre/helper-abslibre @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. libremessages +. "$(librelib messages)" setup_traps set -u diff --git a/src/xbs/xbs b/src/xbs/xbs index 6319110..ad2fbe0 100755 --- a/src/xbs/xbs +++ b/src/xbs/xbs @@ -19,7 +19,7 @@ default_libdir=/usr/lib/xbs -. libremessages +. "$(librelib messages)" . "$(librelib conf)" errusage() { -- cgit v1.2.2