From 3aacf643806bba94eab27a855f4e8c87584a233c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 20 Jan 2017 17:44:01 -0500 Subject: db-import-archlinux-src: Tidy config variable names. --- db-import-archlinux-src | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/db-import-archlinux-src b/db-import-archlinux-src index ca85654..f951f6d 100755 --- a/db-import-archlinux-src +++ b/db-import-archlinux-src @@ -3,14 +3,13 @@ set -e FTP_BASE=/srv/repo/main -ABSLIBRE=/srv/abslibre -ABSGIT=https://git.parabola.nu/abslibre.git/ SYNCARGS='-mrtv --no-motd --delete-after --no-p --no-o --no-g --quiet' -# Variables from abs.conf -ABSROOT="/srv/abs/" -# DON'T CHANGE. WE NEED IT FOR ABSLIBRE -SYNCSERVER="rsync.archlinux.org" +ABSLIBRE_ROOT=/srv/abslibre +ABSLIBRE_GIT=https://git.parabola.nu/abslibre.git/ + +ABS_ROOT="/srv/abs/" +ABS_SERVER="rsync.archlinux.org" # Steps # * Sync abs @@ -20,12 +19,12 @@ SYNCSERVER="rsync.archlinux.org" function sync_abs() { for ARCH in any i686 x86_64; do - rsync ${SYNCARGS} ${SYNCSERVER}::abs/${ARCH}/ ${ABSROOT}/${ARCH} || return $? + rsync ${SYNCARGS} ${ABS_SERVER}::abs/${ARCH}/ ${ABS_ROOT}/${ARCH} || return $? done # fix some permissions - find "${ABSROOT}" -type d -print0 | xargs -0 chmod 755 - find "${ABSROOT}" -type f -print0 | xargs -0 chmod 644 + find "${ABS_ROOT}" -type d -print0 | xargs -0 chmod 755 + find "${ABS_ROOT}" -type f -print0 | xargs -0 chmod 644 } function get_blacklist() { @@ -46,31 +45,31 @@ function sync_abs_libre() { # Clone ABSLibre git repo rm -rf -- "$tmpdir/abslibre" - git clone "$ABSGIT" "$tmpdir/abslibre" + git clone "$ABSLIBRE_GIT" "$tmpdir/abslibre" # Sync from ABS and then sync from ABSLibre printf ":: Syncing ABSLibre...\t" - if ! rsync ${SYNCARGS} --delete-excluded --exclude-from=${BLFILE} ${ABSROOT} ${ABSLIBRE}; then + if ! rsync ${SYNCARGS} --delete-excluded --exclude-from=${BLFILE} ${ABS_ROOT} ${ABSLIBRE_ROOT}; then printf "[FAILED]\n" return 1 fi for ARCH in i686 x86_64; do - if ! rsync -v -mrtq --no-motd --no-p --no-o --no-g --quiet --exclude=.git/ "$tmpdir/abslibre/" ${ABSLIBRE}/${ARCH}/; then + if ! rsync -v -mrtq --no-motd --no-p --no-o --no-g --quiet --exclude=.git/ "$tmpdir/abslibre/" ${ABSLIBRE_ROOT}/${ARCH}/; then printf "[FAILED]\n" return 1 fi done # fix some permissions - find "${ABSLIBRE}" -type d -print0 | xargs -0 chmod 755 - find "${ABSLIBRE}" -type f -print0 | xargs -0 chmod 644 + find "${ABSLIBRE_ROOT}" -type d -print0 | xargs -0 chmod 755 + find "${ABSLIBRE_ROOT}" -type f -print0 | xargs -0 chmod 644 printf "[OK]\n" } # Create .abs.tar.gz tarballs create_tarballs() { - for repo in ${ABSLIBRE}/{i686,x86_64}/*; do + for repo in ${ABSLIBRE_ROOT}/{i686,x86_64}/*; do baserepo=${repo##*/} arch=$(basename $(dirname $repo)) @@ -80,8 +79,8 @@ create_tarballs() { # Create a new one joining arch and any # Remove the first part of the path (it could be $repo but any isn't hit) bsdtar -czf $FTP_BASE/$baserepo/os/$arch/$baserepo.abs.tar.gz \ - -s ":${ABSLIBRE}/[a-z0-9_]\+/[a-z]\+::" \ - $repo/* ${ABSLIBRE}/any/${baserepo}/* + -s ":${ABSLIBRE_ROOT}/[a-z0-9_]\+/[a-z]\+::" \ + $repo/* ${ABSLIBRE_ROOT}/any/${baserepo}/* done } -- cgit v1.2.3