summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-08 14:29:01 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-08 14:29:01 -0600
commitbfb869816713ee2d635220b803cd8eb89f4cf444 (patch)
tree404b2422272986cd414881397410c26c5f18efde /src
parent18b74bdc32406fbe4b79c5efc0f1814683ba2b9a (diff)
libreblacklist: fix a few bugs
- set -e didn't work in blacklist-update when followed by || - it prompted before overwriting the local blacklist
Diffstat (limited to 'src')
-rw-r--r--src/lib/conf.sh2
-rwxr-xr-xsrc/lib/libreblacklist7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/conf.sh b/src/lib/conf.sh
index 67aeb96..840e908 100644
--- a/src/lib/conf.sh
+++ b/src/lib/conf.sh
@@ -93,7 +93,7 @@ load_files() {
# Load the files
for file in $(list_files $slug); do
if [[ -r $file ]]; then
- . "$file"
+ . "$file" || return 1
fi
done
diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist
index 5cfb410..fb8b43a 100755
--- a/src/lib/libreblacklist
+++ b/src/lib/libreblacklist
@@ -40,10 +40,9 @@ blacklist-cat() {
# Usage: blacklist-update
# Updates (or creates) the cached copy of the blacklist
blacklist-update() (
- set -euE # allow it to not be set globally
. libremessages
- load_files libretools
- check_vars libretools BLACKLIST
+ load_files libretools || return 1
+ check_vars libretools BLACKLIST || return 1
local remote_blacklist="$BLACKLIST"
local local_blacklist="$XDG_CACHE_HOME/libretools/blacklist.txt"
@@ -53,7 +52,7 @@ blacklist-update() (
mkdir -p "${local_blacklist%/*}"
if wget -N -q -O "${local_blacklist}.part" "$remote_blacklist" 2>/dev/null; then
stat_done
- mv "${local_blacklist}.part" "$local_blacklist"
+ mv -f "${local_blacklist}.part" "$local_blacklist"
else
stat_done
rm "${local_blacklist}.part"