From 63381988ae8a0f4e0c8eaede88b43a5f685ec80f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 17 Jun 2014 23:25:11 -0400 Subject: remove more scripts that I know to be obsolete --- cron-jobs/update-web-db | 78 ------------------------------------------- cron-jobs/update-web-files-db | 1 - migrate-repo | 29 ---------------- repo-restore-to-normal | 58 -------------------------------- 4 files changed, 166 deletions(-) delete mode 100755 cron-jobs/update-web-db delete mode 120000 cron-jobs/update-web-files-db delete mode 100755 migrate-repo delete mode 100755 repo-restore-to-normal diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db deleted file mode 100755 index 713e75e..0000000 --- a/cron-jobs/update-web-db +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -. "$(dirname "$(readlink -e "$0")")/../config" -. "$(dirname "$(readlink -e "$0")")/../db-functions" - -# setup paths -SPATH="/srv/http/archweb" -ENVPATH="/srv/http/archweb-env/bin/activate" - -# having "more important repos" last should make [core] trickle to the top of -# the updates list each hour rather than being overwhelmed by big [extra] and -# [community] updates -REPOS=('community-testing' 'multilib-testing' 'multilib' 'community' 'extra' 'testing' 'core') -LOGOUT="/tmp/archweb_update.log" - -# figure out what operation to perform -cmd="${0##*/}" -if [[ $cmd != "update-web-db" && $cmd != "update-web-files-db" ]]; then - die "Invalid command name '$cmd' specified!" -fi - -script_lock - -# run at nice 5. it can churn quite a bit of cpu after all. -renice +5 -p $$ > /dev/null - -echo "$cmd: Updating DB at $(date)" >> "${LOGOUT}" - -# source our virtualenv if it exists -if [ -f "$ENVPATH" ]; then - . "$ENVPATH" -fi - -case "$cmd" in - update-web-db) - dbfileext="${DBEXT}" - flags="" - ;; - update-web-files-db) - dbfileext="${FILESEXT}" - flags="--filesonly" - ;; -esac - -# Lock the repos and get a copy of the db files to work on -for repo in ${REPOS[@]}; do - for arch in ${ARCHES[@]}; do - repo_lock ${repo} ${arch} || exit 1 - dbfile="/srv/ftp/${repo}/os/${arch}/${repo}${dbfileext}" - if [ -f "${dbfile}" ]; then - mkdir -p "${WORKDIR}/${repo}/${arch}" - cp "${dbfile}" "${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}" - fi - repo_unlock ${repo} ${arch} - done -done - -# Run reporead on our db copy -pushd $SPATH >/dev/null -for repo in ${REPOS[@]}; do - for arch in ${ARCHES[@]}; do - dbcopy="${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}" - if [ -f "${dbcopy}" ]; then - echo "Updating ${repo}-${arch}" >> "${LOGOUT}" - ./manage.py reporead ${flags} ${arch} "${dbcopy}" >> "${LOGOUT}" 2>&1 - echo "" >> "${LOGOUT}" - fi - done -done -popd >/dev/null -echo "" >> "${LOGOUT}" - -# rotate the file if it is getting big (> 10M), overwriting any old backup -if [[ $(stat -c%s "${LOGOUT}") -gt 10485760 ]]; then - mv "${LOGOUT}" "${LOGOUT}.old" -fi - -script_unlock diff --git a/cron-jobs/update-web-files-db b/cron-jobs/update-web-files-db deleted file mode 120000 index 0c2c4fa..0000000 --- a/cron-jobs/update-web-files-db +++ /dev/null @@ -1 +0,0 @@ -update-web-db \ No newline at end of file diff --git a/migrate-repo b/migrate-repo deleted file mode 100755 index 751d5bd..0000000 --- a/migrate-repo +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -source "$(dirname "$(readlink -e "$0")")/config" - -#dryrun="--dry-run" - -# Sync our repos -#for parabola_repo in ${OURREPOS[@]} ${USERREPOS[@]} ${PROJREPOS[@]}; do -for parabola_repo in ${USERREPOS[@]} ${PROJREPOS[@]}; do - echo ":: Syncing ${parabola_repo}/ => ${FTP_BASE}/${parabola_repo}/" - rsync -avL ${dryrun} --progress -e ssh parabolavnx@69.163.153.218:repo/${parabola_repo}/ ${FTP_BASE}/${parabola_repo}/ -done - -# Sync our arches -#for parabola_arch in ${OURARCHES[@]}; do -#for arch_repo in ${ARCHREPOS[@]}; do - #echo ":: Syncing ${arch_repo}/os/${parabola_arch}/ => ${FTP_BASE}/${arch_repo}/os/${parabola_arch}/" -# rsync -avL ${dryrun} --progress -e ssh parabolavnx@69.163.153.218:repo/${arch_repo}/os/${parabola_arch}/ ${FTP_BASE}/${arch_repo}/os/${parabola_arch}/ -#done -#done -# -# Sync other dirs last -#for other in screenshots isos; do -for other in other; do - echo ":: Syncing ${other}/ => ${FTP_BASE}/${other}/" - rsync -avL ${dryrun} --progress -e ssh parabolavnx@69.163.153.218:repo/${other}/ ${FTP_BASE}/${other} -done - -exit $? diff --git a/repo-restore-to-normal b/repo-restore-to-normal deleted file mode 100755 index 063aacf..0000000 --- a/repo-restore-to-normal +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Solves issue165 - -. "$(dirname "$(readlink -e "$0")")/config" -. "$(dirname "$(readlink -e "$0")")/db-functions" - -CLEANUP_DESTDIR=/home/parabolavnx/repo/pool/restore -PKGREPOS=(community) - -# Find all pkgnames on old with pkgver-pkgrels -#on_repo=($(find ${CLEANUP_DESTDIR} -name "*.pkg.tar.?z" -printf "%f\n" | \ -# sed "s/^\(.\+-[^-]\+-[^-]\+\)-[^-]\+$/\1/")) - -# Traverse all repos -for _repo in "${PKGREPOS[@]}"; do - msg "Restoring [${_repo}]" - -# Find all pkgnames on this repo's abs - on_abs=($( - find ${SVNREPO}/${_repo} -name PKGBUILD | \ - while read pkgbuild; do - unset pkgname pkgver pkgrel - source ${pkgbuild} >/dev/null 2>&1 -# cleanup to save memory - unset build package source md5sums pkgdesc epoch \ - url license arch depends makedepends optdepends options \ - >/dev/null 2>&1 - -# also cleanup package functions - for _pkg in "${pkgname[@]}"; do - unset package_${pkg} >/dev/null 2>&1 -# this fills the on_abs array - echo ${_pkg}-${pkgver}-${pkgrel} - done - - done - )) - -# quit if abs is empty - if [ ${#on_abs[*]} -eq 0 ]; then - warning "[${_repo}]'s ABS tree is empty, skipping" - continue - fi - -# Compares them, whatever is on abs should be restored -# restore=($(comm -12 <(echo ${on_abs[@]} | tr ' ' "\n" | sort -u) \ -# <(echo ${on_repo[@]} | tr ' ' "\n" | sort -u))) - - msg2 "Restoring the following packages:" -# plain "$(echo ${restore[@]} | tr ' ' "\n")" - - for _pkg in "${on_abs[@]}"; do - find ${CLEANUP_DESTDIR} -name "${_pkg}*" -exec cp -v '{}' ${STAGING}/${_repo} \; - done - -done - -exit $? -- cgit v1.2.3