summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-08-09 00:35:39 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-11-20 22:51:10 -0500
commitc95eb790a879bc3e2128e5120ae76cc3f95ac74c (patch)
tree182e3155978ab68250e1aa887746eb40aa8829e1 /src/lib
parent41346f5871f10d261f9202e8d66a8e1c04124a32 (diff)
normalize `source` calls
Diffstat (limited to 'src/lib')
-rwxr-xr-xsrc/lib/blacklist.sh6
-rw-r--r--src/lib/conf.sh.in4
-rwxr-xr-xsrc/lib/libreblacklist7
-rwxr-xr-xsrc/lib/librelib2
-rwxr-xr-xsrc/lib/libremessages5
-rwxr-xr-xsrc/lib/librexgettext3
-rw-r--r--src/lib/messages.sh2
7 files changed, 17 insertions, 12 deletions
diff --git a/src/lib/blacklist.sh b/src/lib/blacklist.sh
index 84333e8..6b1898d 100755
--- a/src/lib/blacklist.sh
+++ b/src/lib/blacklist.sh
@@ -19,8 +19,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
# make sure XDG_CACHE_HOME is set
-. "$(librelib conf)"
+source "$(librelib conf)"
+
# Usage: blacklist-normalize <$file
# Normalizes the syntax of the blacklist on stdin.
@@ -50,7 +52,7 @@ blacklist-cat() {
# Usage: blacklist-update
# Updates (or creates) the cached copy of the blacklist.
blacklist-update() (
- . "$(librelib messages)"
+ source "$(librelib messages)"
load_conf libretools.conf BLACKLIST || return
local remote_blacklist="$BLACKLIST"
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index 0cd0a03..25afa1d 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -127,7 +127,7 @@ load_conf() {
# Load the files
for file in "${files[@]}"; do
if [[ -r $file ]]; then
- . "$file" || return 6 # $EXIT_NOTCONFIGURED
+ source "$file" || return 6 # $EXIT_NOTCONFIGURED
fi
done
@@ -236,6 +236,6 @@ load_PKGBUILD() {
unset_PKGBUILD
# shellcheck disable=2034
CARCH="$(get_var makepkg CARCH "$(uname -m)")"
- . "$file"
+ source "$file"
pkgbase=${pkgbase:-${pkgname[0]}}
}
diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist
index 809e141..948647e 100755
--- a/src/lib/libreblacklist
+++ b/src/lib/libreblacklist
@@ -17,12 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [[ "${0##*/}" != libreblacklist ]]; then
- . "$(librelib blacklist)"
+ source "$(librelib blacklist)"
else
set -euE
lib_file="$(librelib blacklist)"
- . "$lib_file"
+ source "$lib_file"
usage-outside() {
sed -n '/^# Usage:/,/()/p' "$lib_file" |
@@ -40,7 +40,8 @@ else
usage() {
export TEXTDOMAIN='librelib'
export TEXTDOMAINDIR='/usr/share/locale'
- . "$(librelib messages)"
+ source "$(librelib messages)"
+
if [[ $# -eq 0 ]]; then
print "Usage: %s [-h] COMMAND [ARGUMENTS]" "${0##*/}"
print "Tool for working with the nonfree software blacklist"
diff --git a/src/lib/librelib b/src/lib/librelib
index 004c8b1..75f1d5a 100755
--- a/src/lib/librelib
+++ b/src/lib/librelib
@@ -49,7 +49,7 @@ usage() {
changed with the environmental variable LIBRETOOLS_LIBDIR.' "$default_libdir"
echo
print "Example usage:"
- printf ' . $(%s conf)\n' "$cmd"
+ printf ' source $(%s conf)\n' "$cmd"
echo
print "Options:"
flag '-h' 'Show this message'
diff --git a/src/lib/libremessages b/src/lib/libremessages
index 95f2afa..43779af 100755
--- a/src/lib/libremessages
+++ b/src/lib/libremessages
@@ -16,10 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
if [[ "${0##*/}" != libremessages ]]; then
- . "$(librelib messages)"
+ source "$(librelib messages)"
else
set -euE
- . "$(librelib messages)"
+ source "$(librelib messages)"
"$@"
fi
diff --git a/src/lib/librexgettext b/src/lib/librexgettext
index dce7010..793dec7 100755
--- a/src/lib/librexgettext
+++ b/src/lib/librexgettext
@@ -52,7 +52,8 @@ errusage() {
}
usage() {
- . "$(librelib messages)"
+ source "$(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 67cdab5..283102d 100644
--- a/src/lib/messages.sh
+++ b/src/lib/messages.sh
@@ -36,7 +36,7 @@ _INCLUDE_MESSAGES_SH=true
# Inherit most functions from devtools #
################################################################################
-. "$(librelib common)"
+source "$(librelib common)"
################################################################################
# Own functions #