summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-31 18:52:49 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 19:53:19 -0600
commit1316ba7aa96c69ea541f1b7b3715aad5d1c8eb14 (patch)
treedf265c278a4bcb4823a725b9d78936d6f6fc67ef
parent29230b22081f9982f02d1c2fa46834089422d098 (diff)
[all tools]: use conf.sh (and libremessages if necessary)
-rwxr-xr-xsrc/abslibre-tools/createworkdir7
-rwxr-xr-xsrc/abslibre-tools/libreaddiff6
-rwxr-xr-xsrc/abslibre-tools/librerelease17
-rwxr-xr-xsrc/abslibre-tools/librestage10
-rwxr-xr-xsrc/aur2
-rwxr-xr-xsrc/diff-unfree5
-rwxr-xr-xsrc/fullpkg/fullpkg-build18
-rwxr-xr-xsrc/fullpkg/fullpkg-find9
-rwxr-xr-xsrc/librediff3
-rwxr-xr-xsrc/mips64el-tools/mipsrelease9
-rwxr-xr-xsrc/toru/toru-info2
-rwxr-xr-xsrc/toru/toru-utils20
-rwxr-xr-xsrc/toru/toru-where4
-rwxr-xr-xsrc/treepkg9
14 files changed, 54 insertions, 67 deletions
diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir
index 2fdf107..e98da3e 100755
--- a/src/abslibre-tools/createworkdir
+++ b/src/abslibre-tools/createworkdir
@@ -21,9 +21,10 @@
# You should have received a copy of the GNU General Public License
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-source /etc/libretools.conf
-custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
-[[ -e $custom_config ]] && source $custom_config
+. libremessages
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools WORKDIR REPOS ABSLIBREGIT || exit 1
[[ ! -d ${WORKDIR} ]] && { # Create the WORKDIR
diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff
index a75fb02..fafdada 100755
--- a/src/abslibre-tools/libreaddiff
+++ b/src/abslibre-tools/libreaddiff
@@ -15,9 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. /etc/libretools.conf
-custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
-[ -e $custom_config ] && . $custom_config
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools WORKDIR
for arg in "$@" ; do
case "$arg" in
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index 5a98cf8..265550f 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -21,8 +21,12 @@
# You should have received a copy of the GNU General Public License
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-source /etc/libretools.conf
-custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
+. libremessages
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools WORKDIR PARABOLAHOST LIBREDESTDIR SIGID || exit 1
+# The following variables are actually optional
+#check_vars libretools SIGEXT HOOKPRERELEASE || exit 1
function usage {
echo "$(gettext "Usage: $0")"
@@ -108,17 +112,10 @@ while getopts 'hlcn' arg; do
esac
done
-[[ -e $custom_config ]] && source $custom_config
-
[[ ! -z ${HOOKPRERELEASE} ]] && bash -c "${HOOKPRERELEASE}"
clean_non_packages
-if [ ! -z "${SIGID}" ]; then
- sign_packages
-else
- error "Package signing is *required*, please set SIGID on your libretools.conf"
- exit 1
-fi
+sign_packages
# Make the permissions of the packages 644 otherwise the user will get access
# denied error when they try to download (rsync --no-perms doesn't seem to
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage
index ae66cce..c0936cc 100755
--- a/src/abslibre-tools/librestage
+++ b/src/abslibre-tools/librestage
@@ -22,9 +22,10 @@
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-source /etc/libretools.conf
-custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
-[[ -e $custom_config ]] && source $custom_config
+. libremessages
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools ARCHES WORKDIR || exit 1
if [ -w / ]; then
error "This script should be run as regular user"
@@ -68,8 +69,7 @@ fi
}
# Source the needed files
-source /etc/makepkg.conf
-[[ -e ~/.makepkg.conf ]] && source ~/.makepkg.conf
+load_files makepkg
source ./PKGBUILD
[[ -e ./rePKGBUILD ]] && source ./rePKGBUILD
diff --git a/src/aur b/src/aur
index 8ef20cf..a09c923 100755
--- a/src/aur
+++ b/src/aur
@@ -45,7 +45,7 @@ main() {
. $(librelib conf.sh)
load_files libretools
- check_vars libretools DIFFTOOL
+ check_vars libretools DIFFTOOL || exit 1
local missing_deps=()
local ret=0
diff --git a/src/diff-unfree b/src/diff-unfree
index a770214..59fcbae 100755
--- a/src/diff-unfree
+++ b/src/diff-unfree
@@ -20,7 +20,10 @@
# You should have received a copy of the GNU General Public License
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-. /etc/libretools.conf
+. libremessages
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools DIFFTOOL || exit 1
cmd=${0##*/}
diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build
index b497db5..e52bff1 100755
--- a/src/fullpkg/fullpkg-build
+++ b/src/fullpkg/fullpkg-build
@@ -5,13 +5,13 @@
# TODO move __build to chroot
-source /etc/makepkg.conf
-source /etc/libretools.conf
-
-if [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
- source $XDG_CONFIG_HOME/libretools/libretools.conf
-fi
-
+. libremessages
+. $(librelib conf.sh)
+load_files makepkg
+load_files libretools
+check_vars libretools FULLBUILDCMD || exit 1
+# The following variables are actually optional
+#check_vars libretools HOOKPKGBUILDMOD HOOKLOCALRELEASE || exit 1
## List packages on log that are on status
## usage: list_pkgs <status> <message>
@@ -189,10 +189,6 @@ if "$CHECKNONFREE"; then
check_nonfree
fi
-if [ -z "$FULLBUILDCMD" ]; then
- error "Set your FULLBUILDCMD on libretools.conf"
-fi
-
msg "$MESSAGE"
__build
diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find
index b09edf9..dbe65df 100755
--- a/src/fullpkg/fullpkg-find
+++ b/src/fullpkg/fullpkg-find
@@ -129,12 +129,9 @@ find_deps() {
unset next_level dir
}
-source /etc/libretools.conf
-source /etc/makepkg.conf
-
-if [ -e $XDG_CONFIG_HOME/libretools/libretools.conf ]; then
- source $XDG_CONFIG_HOME/libretools/libretools.conf
-fi
+. libremessages
+. $(librelib conf.sh)
+load_files makepkg
LEVEL=0
MAXLEVEL=20
diff --git a/src/librediff b/src/librediff
index f84d037..3130b86 100755
--- a/src/librediff
+++ b/src/librediff
@@ -20,9 +20,10 @@
# You should have received a copy of the GNU General Public License
# along with Parabola. If not, see <http://www.gnu.org/licenses/>.
+. libremessages
. $(librelib conf.sh)
load_files libretools
-check_vars libretools PATCHDIR
+check_vars libretools PATCHDIR || exit 1
cmd=${0##*/}
diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease
index 4d7a7de..393ca08 100755
--- a/src/mips64el-tools/mipsrelease
+++ b/src/mips64el-tools/mipsrelease
@@ -7,10 +7,11 @@
# $1 repo
# $2+ packages
-source /etc/makepkg.conf
-source /etc/libretools.conf
-
-libretoolsdir="$(dirname $0)/../"
+. libremessages
+. $(librelib conf.sh)
+load_files makepkg
+load_files libretools
+check_vars libretools WORKDIR || exit 1
usage() {
echo "$0 repo package1 [ package2 ... packageN ]"
diff --git a/src/toru/toru-info b/src/toru/toru-info
index 523f682..5b6fd01 100755
--- a/src/toru/toru-info
+++ b/src/toru/toru-info
@@ -1,6 +1,6 @@
#!/bin/bash
# Prints info about a given pkgname
-source /etc/libretools.conf
+. libremessages
for _pkg in $@; do
_pkgbuild="$(toru-where $_pkg)"
diff --git a/src/toru/toru-utils b/src/toru/toru-utils
index 316e6b8..acf3776 100755
--- a/src/toru/toru-utils
+++ b/src/toru/toru-utils
@@ -1,27 +1,15 @@
#!/bin/bash
-source /etc/abs.conf
-source /etc/libretools.conf
+. libremessages
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools TORUPATH || exit 1
LASTSYNCFILE=${TORUPATH}/lastsync
FORCE=false
QUIET=false
DEBUG=false
-# usage : in_array( $needle, $haystack )
-function in_array {
- [[ $2 ]] || return 1 # Not found
-
- local needle=$1; shift
- local item
-
- for item in "$@"; do
- [[ ${item#@} = $needle ]] && return 0 # Found
- done
-
- return 1 # Not Found
-}
-
# Stores the lastsync date
lastsync() {
local lastsyncfile
diff --git a/src/toru/toru-where b/src/toru/toru-where
index e9ab29d..8af3fb2 100755
--- a/src/toru/toru-where
+++ b/src/toru/toru-where
@@ -1,6 +1,8 @@
#!/bin/bash
# Locates a PKGBUILD dir on toru's path cache
-source /etc/libretools.conf
+. $(librelib conf.sh)
+load_files libretools
+check_vars libretools TORUPATH || exit 1
PATHFILE=${TORUPATH}/paths.tch
diff --git a/src/treepkg b/src/treepkg
index 519dee5..22485d2 100755
--- a/src/treepkg
+++ b/src/treepkg
@@ -15,14 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-source /etc/libretools.conf
-source $XDG_CONFIG_HOME/libretools/libretools.conf >/dev/null 2>&1|| true
+source libremessages
+source $(librelib conf.sh)
+
+load_conf_libretools
term_title "$(basename $0)"
# Get system variables
-source /etc/makepkg.conf
-source $HOME/makepkg.conf >/dev/null 2>&1|| true
+load_files makepkg
# End inmediately but print an useful message
trap_exit() {