diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2018-06-22 13:22:49 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-10-07 19:40:06 -0400 |
commit | 982bc5c0e3a8f0ad5a513ace1ea8ddfb55b6a63d (patch) | |
tree | 31d7a7dad8f9cf5fcde390cbaf5e07ac50f26342 | |
parent | c3a616f64fb29804695440811489e547e1f56506 (diff) |
Add from Parabola: db-init
If you're seeing this in `git blame`, it chose to follow the wrong
ancestor of a merge commit.
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | db-init | 28 |
2 files changed, 30 insertions, 0 deletions
@@ -23,6 +23,7 @@ The executables that you (might) care about are: ├── db-import-any [Parabola only] ├── db-import-pkg [Parabola only] ├── db-import-keyring [Parabola only] + ├── db-init [Parabola only] ├── db-move ├── db-remove ├── db-repo-add @@ -89,6 +90,7 @@ Things that haven't been mentioned yet: - `cron-jobs/devlist-mailer` - `cron-jobs/make_repo_torrents` - `cron-jobs/sourceballs` + - `db-init` ## 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`. @@ -0,0 +1,28 @@ +#!/bin/bash +# Creates the repo structure defined in config + +source "$(dirname "$(readlink -e "$0")")/config" + +umask 002 + +mkdir -pv -- "${FTP_BASE}"/{"${PKGPOOL}","${SRCPOOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" + +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do + mkdir -pv -- "${FTP_BASE}/${repo}/os/${arch}" + if ! [[ -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]]; then + touch -- "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" + printf 'created file %q\n' "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" + fi + if ! [[ -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}" ]]; then + touch -- "${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}" + printf 'created file %q\n' "${FTP_BASE}/${repo}/os/${arch}/${repo}${FILESEXT}" + fi + if ! [[ -L "${FTP_BASE}/${repo}/os/${arch}/${repo}.db" ]]; then + ln -svT -- "${repo}${DBEXT}" "${FTP_BASE}/${repo}/os/${arch}/${repo}.db" + fi + if ! [[ -L "${FTP_BASE}/${repo}/os/${arch}/${repo}.files" ]]; then + ln -svT -- "${repo}${FILESEXT}" "${FTP_BASE}/${repo}/os/${arch}/${repo}.files" + fi + done +done |