summaryrefslogtreecommitdiff
path: root/src/abslibre-tools/libredbdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/abslibre-tools/libredbdiff')
-rwxr-xr-xsrc/abslibre-tools/libredbdiff94
1 files changed, 45 insertions, 49 deletions
diff --git a/src/abslibre-tools/libredbdiff b/src/abslibre-tools/libredbdiff
index 074d8fe..28279ad 100755
--- a/src/abslibre-tools/libredbdiff
+++ b/src/abslibre-tools/libredbdiff
@@ -60,54 +60,6 @@ createdir() {
fi
}
-initialize() {
- createdir "$statedir"
-
- if [[ ! -e "$conffile_prbl" ]] ; then
- msg "Generating %s %q" Parabola pacman.conf
- cp -T /usr/share/pacman/defaults/pacman.conf.x86_64 "$conffile_prbl"
- sed -r \
- -e "s|/etc/pacman\.d/mirrorlist$|$mirrorlist_prbl|" \
- -e "s|^#?DBPath\s*=.*|DBPath = $dbpath_prbl|" \
- -e "s|^#?Architecture\s*=.*|Architecture = x86_64|" \
- -i "$conffile_prbl"
- local repo
- for repo in multilib {libre,pcr,nonprism}{,-multilib}; do
- enablerepo "$repo" "$conffile_prbl"
- done
- else
- warning "%q already exists. Skipping." "$conffile_prbl"
- fi
-
- if [[ ! -e "$conffile_arch" ]] ; then
- msg "Generating %s %q" Arch pacman.conf
- wget -q \
- -O "$conffile_arch" \
- "https://git.archlinux.org/svntogit/packages.git/plain/pacman/repos/core-x86_64/pacman.conf.x86_64" ||
- die "Failed to download %q. Exiting." "$conffile_arch"
- sed -r \
- -e "s|/etc/pacman\.d/mirrorlist$|$mirrorlist_arch|" \
- -e "s|^#?DBPath\s*=.*|DBPath = $dbpath_arch|" \
- -e "s|^#?Architecture\s*=.*|Architecture = x86_64|" \
- -i "$conffile_arch"
- enablerepo multilib "$conffile_arch"
- else
- warning "%q already exists. Skipping." "$conffile_arch"
- fi
-
- if [[ ! -e "$mirrorlist_prbl" ]] ; then
- printf 'Server = %s\n' "$mirror_prbl" > "$mirrorlist_prbl"
- else
- warning "%q already exists. Skipping." "$mirrorlist_prbl"
- fi
-
- if [[ ! -e "$mirrorlist_arch" ]] ; then
- printf 'Server = %s\n' "$mirror_arch" > "$mirrorlist_arch"
- else
- warning "%q already exists. Skipping." "$mirrorlist_arch"
- fi
-}
-
# Globals:
# - pkgname : the Parabola pkgname
# - ver_prbl : a map of pkgname->arch_pkgver
@@ -265,7 +217,51 @@ main_update() {
fi
check_vars libredbdiff statedir mirror_prbl mirror_arch || exit 1
- initialize
+ createdir "$statedir"
+
+ if [[ ! -e "$conffile_prbl" ]] ; then
+ msg "Generating %s %q" Parabola pacman.conf
+ cp -T /usr/share/pacman/defaults/pacman.conf.x86_64 "$conffile_prbl"
+ sed -r \
+ -e "s|/etc/pacman\.d/mirrorlist$|$mirrorlist_prbl|" \
+ -e "s|^#?DBPath\s*=.*|DBPath = $dbpath_prbl|" \
+ -e "s|^#?Architecture\s*=.*|Architecture = x86_64|" \
+ -i "$conffile_prbl"
+ local repo
+ for repo in multilib {libre,pcr,nonprism}{,-multilib}; do
+ enablerepo "$repo" "$conffile_prbl"
+ done
+ else
+ warning "%q already exists. Skipping." "$conffile_prbl"
+ fi
+
+ if [[ ! -e "$conffile_arch" ]] ; then
+ msg "Generating %s %q" Arch pacman.conf
+ wget -q \
+ -O "$conffile_arch" \
+ "https://git.archlinux.org/svntogit/packages.git/plain/pacman/repos/core-x86_64/pacman.conf.x86_64" ||
+ die "Failed to download %q. Exiting." "$conffile_arch"
+ sed -r \
+ -e "s|/etc/pacman\.d/mirrorlist$|$mirrorlist_arch|" \
+ -e "s|^#?DBPath\s*=.*|DBPath = $dbpath_arch|" \
+ -e "s|^#?Architecture\s*=.*|Architecture = x86_64|" \
+ -i "$conffile_arch"
+ enablerepo multilib "$conffile_arch"
+ else
+ warning "%q already exists. Skipping." "$conffile_arch"
+ fi
+
+ if [[ ! -e "$mirrorlist_prbl" ]] ; then
+ printf 'Server = %s\n' "$mirror_prbl" > "$mirrorlist_prbl"
+ else
+ warning "%q already exists. Skipping." "$mirrorlist_prbl"
+ fi
+
+ if [[ ! -e "$mirrorlist_arch" ]] ; then
+ printf 'Server = %s\n' "$mirror_arch" > "$mirrorlist_arch"
+ else
+ warning "%q already exists. Skipping." "$mirrorlist_arch"
+ fi
createdir "$dbpath_prbl"
msg "Synchronizing %s pacman databases for %s" "$name" "Parabola"