summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-03-17 00:18:46 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-08-20 19:53:44 -0400
commit8dfc376f2673011e088de8952a3dc0042709a735 (patch)
tree193d095dba44bd1fd443848509435f66b284764d
parent9f417ef2c4bee021194617714001514b12d3efd4 (diff)
rm testing2x cron-jobs/update-web-*
-rw-r--r--README.md13
-rw-r--r--config2
-rwxr-xr-xcron-jobs/update-web-db78
l---------cron-jobs/update-web-files-db1
-rw-r--r--test/cases/common.bats2
-rw-r--r--test/cases/testing2x.bats16
-rwxr-xr-xtesting2x55
7 files changed, 4 insertions, 163 deletions
diff --git a/README.md b/README.md
index 0292adb..9f5a415 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,14 @@ The executables that you (might) care about are:
│   ├── ftpdir-cleanup
│   ├── integrity-check
│   ├── sourceballs
- │   ├── update-web-db
- │   └── update-web-files-db
+ │   ├── update-web-db [Arch Linux only]
+ │   └── update-web-files-db [Arch Linux only]
├── db-move
├── db-remove
├── db-repo-add
├── db-repo-remove
├── db-update
- └── testing2x
+ └── testing2x [Arch Linux only]
Ok, now let's talk about what those are.
@@ -29,11 +29,6 @@ There are 3 "main" programs:
- `db-remove` : remove packages from repositories
- `db-move` : move packages from one repository to another
-Moving packages from testing to stable repositories is such a common
-task that we have a wrapper around `db-move` to make it easier:
-
- - `testing2x`
-
Of course, sometimes things go wrong, and you need to drop to a
lower-level, but you don't want to go all the way down to pacman's
`repo-add`/`repo-remove`. So, we have:
@@ -56,8 +51,6 @@ Things that haven't been mentioned yet:
- `cron-jobs/devlist-mailer`
- `cron-jobs/sourceballs`
- - `cron-jobs/update-web-db`
- - `cron-jobs/update-web-files-db`
## Testing
* Install the `base-devel` package group, as well as the `bash-bats`, `kcov`, `librelib`, and `subversion` packages.
* The test suite can now be run with `make test`.
diff --git a/config b/config
index 3cbc176..badaf84 100644
--- a/config
+++ b/config
@@ -4,8 +4,6 @@ FTP_BASE="/srv/ftp"
PKGREPOS=()
PKGPOOL=''
SRCPOOL=''
-TESTING_REPO=''
-STABLE_REPOS=()
# VCS backend
VCS=none
diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db
deleted file mode 100755
index 39ed765..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 '%s' specified!" "$cmd"
-fi
-
-script_lock
-
-# run at nice 5. it can churn quite a bit of cpu after all.
-renice +5 -p $$ > /dev/null
-
-echo "%s: Updating DB at %s" "$cmd" "$(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/test/cases/common.bats b/test/cases/common.bats
index 4b798f8..8b4c3a0 100644
--- a/test/cases/common.bats
+++ b/test/cases/common.bats
@@ -1,7 +1,7 @@
load ../lib/common
@test "commands display usage message by default" {
- for cmd in db-move db-remove db-repo-add db-repo-remove testing2x; do
+ for cmd in db-move db-remove db-repo-add db-repo-remove; do
echo Testing $cmd
run $cmd
(( $status == 1 ))
diff --git a/test/cases/testing2x.bats b/test/cases/testing2x.bats
deleted file mode 100644
index 6127cf9..0000000
--- a/test/cases/testing2x.bats
+++ /dev/null
@@ -1,16 +0,0 @@
-load ../lib/common
-
-@test "move any package" {
- releasePackage core pkg-any-a
- db-update
-
- updatePackage pkg-any-a
-
- releasePackage testing pkg-any-a
- db-update
-
- testing2x pkg-any-a
-
- checkPackage core pkg-any-a 1-2
- checkRemovedPackage testing pkg-any-a
-}
diff --git a/testing2x b/testing2x
deleted file mode 100755
index 99280b5..0000000
--- a/testing2x
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-
-. "$(dirname "$(readlink -e "$0")")/config"
-. "$(dirname "$(readlink -e "$0")")/db-functions"
-
-if (( $# < 1 )); then
- msg "usage: %s <pkgname|pkgbase> ..." "${0##*/}"
- exit 1
-fi
-
-# Lock everything to reduce possibility of interfering task between the different repo-updates
-script_lock
-for repo in "${TESTING_REPO}" "${STABLE_REPOS[@]}"; do
- for pkgarch in "${ARCHES[@]}"; do
- repo_lock "${repo}" "${pkgarch}" || exit 1
- done
-done
-
-declare -A pkgs
-
-for pkgbase in "$@"; do
- found_source=false
- for tarch in "${ARCHES[@]}"; do
- if [[ -n $(arch_expac_pkgbase "$TESTING_REPO" "$tarch" '%n' "$pkgbase") ]]; then
- found_source=true
- break
- fi
- done
- [[ $found_source = true ]] || die "%s not found in [%s]" "$pkgbase" "$TESTING_REPO"
- found_target=false
- for tarch in "${ARCHES[@]}"; do
- for repo in "${STABLE_REPOS[@]}"; do
- if [[ -n $(arch_expac_pkgbase "$repo" "$tarch" '%n' "$pkgbase") ]]; then
- found_target=true
- pkgs[${repo}]+="${pkgbase} "
- break 2
- fi
- done
- done
- [[ $found_target = true ]] || die "%s not found in any of these repos: %s" "$pkgbase" "${STABLE_REPOS[*]}"
-done
-
-for pkgarch in "${ARCHES[@]}"; do
- repo_unlock "${TESTING_REPO}" "${pkgarch}"
-done
-for repo in "${STABLE_REPOS[@]}"; do
- for pkgarch in "${ARCHES[@]}"; do
- repo_unlock "${repo}" "${pkgarch}"
- done
- if [[ -n ${pkgs[${repo}]} ]]; then
- "$(dirname "$(readlink -e "$0")")/db-move" "${TESTING_REPO}" "${repo}" ${pkgs[${repo}]}
- fi
-done
-
-script_unlock