summaryrefslogtreecommitdiff
path: root/src/abslibre-tools
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-24 15:17:59 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-24 16:24:13 -0400
commit05128d533225b75f35f79a1f55b04556b7e9736b (patch)
treea2e8d723e76fd8e44c81ea0fbe1ad4dda597856d /src/abslibre-tools
parentd712e575c0d5b1bf66443beec3e7ed75be636e2d (diff)
Merge conf.sh:load_files and conf.sh:check_vars into load_conf
Diffstat (limited to 'src/abslibre-tools')
-rwxr-xr-xsrc/abslibre-tools/createworkdir3
-rwxr-xr-xsrc/abslibre-tools/diff-unfree3
-rwxr-xr-xsrc/abslibre-tools/libreaddiff3
-rwxr-xr-xsrc/abslibre-tools/libredbdiff5
-rwxr-xr-xsrc/abslibre-tools/librerelease19
-rwxr-xr-xsrc/abslibre-tools/librestage10
6 files changed, 15 insertions, 28 deletions
diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir
index e3e4143..6f58b05 100755
--- a/src/abslibre-tools/createworkdir
+++ b/src/abslibre-tools/createworkdir
@@ -29,8 +29,7 @@ set -euE
. "$(librelib conf)"
main() {
- load_files libretools
- check_vars libretools WORKDIR ABSLIBRERECV ABSLIBRESEND # these are asked for by `xbs download`
+ load_conf libretools.conf WORKDIR ABSLIBRERECV ABSLIBRESEND || exit # these are asked for by `xbs download`
trap 'error "Aborting..."' EXIT
diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree
index 2d54379..860c985 100755
--- a/src/abslibre-tools/diff-unfree
+++ b/src/abslibre-tools/diff-unfree
@@ -40,8 +40,7 @@ main() {
return 0
fi
- load_files libretools
- check_vars libretools DIFFPROG || return 1
+ load_conf libretools.conf DIFFPROG || exit
local package_guess=${PWD##*/}
local repo=${1:-$(basename "${PWD%/*}")}
diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff
index b0e2c1d..9336198 100755
--- a/src/abslibre-tools/libreaddiff
+++ b/src/abslibre-tools/libreaddiff
@@ -33,8 +33,7 @@ usage() {
}
main() {
- load_files libretools
- check_vars libretools WORKDIR
+ load_conf libretools.conf WORKDIR || exit
while getopts 'h' arg; do
case "$arg" in
diff --git a/src/abslibre-tools/libredbdiff b/src/abslibre-tools/libredbdiff
index 1903c8c..5d301f6 100755
--- a/src/abslibre-tools/libredbdiff
+++ b/src/abslibre-tools/libredbdiff
@@ -22,7 +22,6 @@
set -euE -o pipefail
. "$(librelib messages)"
. "$(librelib conf)"
-load_files libredbdiff || exit
setup_traps
declare -r name="Libredbdiff"
@@ -245,7 +244,7 @@ main_update() {
usage >&2
exit 1
fi
- check_vars libredbdiff statedir mirror_prbl mirror_arch || exit 1
+ load_conf libredbdiff.conf statedir mirror_prbl mirror_arch || exit
createdir "$statedir"
{
@@ -297,7 +296,7 @@ main_update() {
}
main_compare() {
- check_vars libredbdiff statedir repos || exit 1
+ load_conf libredbdiff.conf statedir repos || exit
if ! [[ -f "$conffile_prbl" && \
-f "$conffile_arch" && \
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index 51cf6de..e673081 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -164,21 +164,10 @@ main() {
return 0
fi
- # defer exiting on errors until we've tried to parse *all*
- # config files, to have more complete error messages.
- local err=false
- {
- load_files makepkg &&
- check_vars makepkg GPGKEY
- } || err=true
- {
- load_files libretools &&
- # the HOOK* are settings are optional
- check_vars libretools WORKDIR REPODEST ABSLIBREDEST # HOOKPRERELEASE HOOKPOSTRELEASE
- } || err=true
- if $err; then
- return 6
- fi
+ declare -i ret=0
+ load_conf makepkg.conf GPGKEY || ret=$?
+ load_conf libretools.conf WORKDIR REPODEST ABSLIBREDEST || ret=$? # and HOOK{PRE,POST}RELEASE, which are optional
+ [[ $ret = 0 ]] || exit $ret
local re_url='^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$'
local re_authority='^(([^@]*)@)?([^][@:]*|\[[^]]*\])(:([0-9]*))?$'
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage
index 74de8fb..0794b13 100755
--- a/src/abslibre-tools/librestage
+++ b/src/abslibre-tools/librestage
@@ -60,10 +60,12 @@ main() {
fi
# Load configuration
- load_files libretools
- check_vars libretools WORKDIR || return 1
- load_files makepkg # for PKGDEST, SRCDEST, and SRCPKGDEST, which are optional
- load_files librefetch # for MIRRORS, which is optional
+ declare -i ret=0
+ load_conf libretools.conf WORKDIR || ret=$?
+ load_conf makepkg.conf || ret=$? # for PKGDEST, SRCDEST, and SRCPKGDEST, which are optional
+ load_conf librefetch.conf || ret=$? # for MIRRORS, which is optional
+ [[ $ret = 0 ]] || exit $ret
+
SRCPKGPOOL="$WORKDIR/staging/sources/parabola"
# Load the PKGBUILD