summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/abslibre-tools/libredbdiff12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/abslibre-tools/libredbdiff b/src/abslibre-tools/libredbdiff
index e88eb91..badb69e 100755
--- a/src/abslibre-tools/libredbdiff
+++ b/src/abslibre-tools/libredbdiff
@@ -70,7 +70,7 @@ createdir() {
if [[ ! -e "$dir" ]] ; then
msg "Creating directory %q" "$dir"
mkdir -- "$dir" || die "Failed to create directory %q. Exiting." "$dir"
- elif [[ -n "$init" ]]; then
+ elif $init; then
warning "%q already exists. Skipping." "$dir"
fi
}
@@ -80,7 +80,7 @@ setmirror() {
local mirror="$2"
local mirrorlist="$3"
- if [[ -n "$init" ]] && [[ -n "$mirror" ]]; then
+ if [[ -n "$mirror" ]]; then
local mirrorescaped
mirrorescaped="${mirror//./\\.}"
mirrorescaped="${mirrorescaped//\$/\\$}"
@@ -310,6 +310,7 @@ main_update() {
fi
check_vars libredbdiff statedir mirror_prbl mirror_arch || exit 1
+ local init=false
if ! [[ -e "$conffile_prbl" && \
-e "$conffile_arch" && \
-e "$mirrorlist_prbl" && \
@@ -317,13 +318,10 @@ main_update() {
warning "At least one %s configuration file is missing." \
"$name"
msg "Downloading and preparing missing configuration files."
- init=1
+ initialize
+ init=true
fi
- createdir "$statedir"
-
- initialize
-
if ! [[ -d "$dbpath_prbl" && \
-d "$dbpath_arch" ]]; then
warning "At least one %s pacman DB directory is missing. Synchronizing %s DB files." \