diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 21:33:20 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 21:33:20 -0400 |
commit | aae3b0a2490d65832547f29327f9e8828442a48d (patch) | |
tree | 29b554ba243e1d97e3104c6c18d9838d6c4fc250 | |
parent | d433fbd1da44acdf3dd50abce428fe57912f9fa7 (diff) |
cleanup:
- move some config into config.local.*
- `mv createrepos db-init`
- `mv {,db-}check-package-libraries.py`
- `mv `list_nonfree_in_db.py db-list-nonfree.py`
- `rm abslibre`: To be replaced by XBS+update abs tarballs script
- `rm create-repo mkrepo`: Both did the same thing, just fancy `mkdir`
- `rm `testing2x`: Just use db-move.
-rwxr-xr-x | abslibre | 124 | ||||
-rw-r--r-- | config | 45 | ||||
-rw-r--r-- | config.local.import-community | 3 | ||||
-rw-r--r-- | config.local.import-packages | 3 | ||||
-rw-r--r-- | config.local.parabola | 8 | ||||
-rwxr-xr-x | create-repo | 21 | ||||
-rwxr-xr-x | db-check-package-libraries.py (renamed from check-package-libraries.py) | 0 | ||||
-rwxr-xr-x | db-init (renamed from createrepos) | 2 | ||||
-rwxr-xr-x | db-list-nonfree.py (renamed from list_nonfree_in_db.py) | 0 | ||||
-rwxr-xr-x | mkrepo | 15 | ||||
-rwxr-xr-x | testing2x | 59 |
11 files changed, 30 insertions, 250 deletions
diff --git a/abslibre b/abslibre deleted file mode 100755 index 0b3e371..0000000 --- a/abslibre +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash - -ABSLIBRE=/srv/abslibre -ABSGIT=/srv/git/repositories/abslibre.git -# Remote -# ABSGIT=http://projects.parabolagnulinux.org/abslibre.git -BLACKLIST='https://projects.parabolagnulinux.org/blacklist.git/plain/blacklist.txt' -SYNCARGS='-mrtv --no-motd --delete-after --no-p --no-o --no-g' -BLFILE=/tmp/blacklist.txt - -# Variables from abs.conf -ABSROOT="/srv/abs/" -# DON'T CHANGE. WE NEED IT FOR ABSLIBRE -SYNCSERVER="rsync.archlinux.org" -ARCH="i686" -MIRRORLIST="/etc/pacman.d/mirrorlist" -REPOS=(core extra community testing community-testing !staging !community-staging) - -# Steps -# * Sync abs -# * Download blacklist.txt -# * Sync abslibre from abs excluding from blacklist -# * Create repo.abs.tar.gz tarballs - -function sync_abs() { - for ARCH in any i686 x86_64; do - rsync ${SYNCARGS} ${SYNCSERVER}::abs/${ARCH}/ ${ABSROOT}/${ARCH} || return $? - done -} - -function get_blacklist() { - printf ":: Updating blacklist...\t" - wget -q -O - "${BLACKLIST}" | cut -d':' -f1 | sort -u | \ - sed "s/^/**\//" > ${BLFILE} || { - printf "[FAILED]\n" - return 1 - } - - # Prevent using an empty blacklist - [ $(wc -l ${BLFILE} | cut -d " " -f1) -eq 0 ] && return 1 - - printf "[OK]\n" -} - -function sync_abs_libre() { - - # Clone ABSLibre git repo - if [ -d /var/tmp/abslibre/.git ]; then - pushd /var/tmp/abslibre >/dev/null 2>&1 - git pull - popd >/dev/null 2>&1 - else - git clone /srv/git/abslibre.git /var/tmp/abslibre - fi - - # Sync from ABS and then sync from ABSLibre - printf ":: Syncing ABSLibre...\t" - (rsync ${SYNCARGS} --delete-excluded \ - --exclude-from=${BLFILE} \ - ${ABSROOT} \ - ${ABSLIBRE} \ - && - for ARCH in i686 x86_64; do rsync -v -mrtq --no-motd --no-p --no-o --no-g --exclude=.git/ /var/tmp/abslibre/ ${ABSLIBRE}/${ARCH}/; done) || { - printf "[FAILED]\n" - return 1 - } - - printf "[OK]\n" -} - -# This part is very hacky and particular to the current setup :P -sync_pre_mips64el() { - pushd /home/fauno/Repos/abslibre-pre-mips64el >/dev/null - - sudo -u fauno sh -c " - rsync ${SYNCARGS} \ - --exclude=.git* \ - --exclude=community-staging \ - --exclude=community-testing \ - --exclude=gnome-unstable \ - --exclude=kde-unstable \ - --exclude=multilib \ - --exclude=multilib-testing \ - --exclude=multilib-staging \ - --exclude=staging \ - --exclude=testing \ - ${ABSLIBRE}/x86_64/ \ - /home/fauno/Repos/abslibre-pre-mips64el/ && - git add . && - git commit -m \"$(date)\" -a - git push origin master - git gc - " -} - -# Create .abs.tar.gz tarballs -create_tarballs() { - for repo in ${ABSLIBRE}/{i686,x86_64}/*; do - baserepo=${repo##*/} - arch=$(basename $(dirname $repo)) - - # Remove the old one - mkdir -p /srv/http/web/media/abs/$baserepo/os/$arch/ - rm /srv/http/web/media/abs/$baserepo/os/$arch/$baserepo.abs.tar.gz - # 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 -czvf /srv/http/web/media/abs/$baserepo/os/$arch/$baserepo.abs.tar.gz \ - -s ":${ABSLIBRE}/[a-z0-9_]\+/[a-z]\+::" \ - $repo/* ${ABSLIBRE}/any/${baserepo}/* - - done -} - -sync_abs || exit 1 -get_blacklist || exit 1 -sync_abs_libre || exit 1 -# This is being done at repo server now -sync_pre_mips64el || exit 1 -#create_tarballs || exit 1 - -echo "Exclusion list used" -cat ${BLFILE} - -exit 0 @@ -1,40 +1,25 @@ #!/bin/bash # non-executable, but put this there as a hint to text editors +case "$USER" in + db-import-packages) _name=import-packages;; + db-import-community) _name=import-community;; + *) _name=parabola;; +esac + FTP_BASE="/srv/http/repo/public" -PKGREPOS=( - # Arch - {core,extra,testing,staging} - {gnome,kde}-unstable - {community,multilib}{,-testing,-staging} - # Parabola - libre{,-testing} - libre-multilib{,-testing} - pcr kernels cross java nonprism - '~smv' '~xihh' '~brendan' '~lukeshu' '~emulatorman' '~aurelien' '~jorginho' '~coadde' '~drtan' -) -PKGPOOL='pool/parabola' -SRCPOOL='sources/parabola' -TESTING_REPO='testing' -STABLE_REPOS=( - # Arch - {core,extra} - {community,multilib} - # Parabola - libre - libre-multilib - pcr kernels cross java nonprism - '~smv' '~xihh' '~brendan' '~lukeshu' '~emulatorman' '~aurelien' '~jorginho' '~coadde' '~drtan' -) - -CLEANUP_DESTDIR="/srv/http/repo/private/cleanup-destdir" +PKGREPOS=() +PKGPOOL='' +SRCPOOL='' + +CLEANUP_DESTDIR="/srv/http/repo/private/${_name}/package-cleanup" CLEANUP_DRYRUN=false # Time in days to keep moved packages CLEANUP_KEEP=30 -SOURCE_CLEANUP_DESTDIR="/srv/http/repo/private/source-cleanup-destdir" +SOURCE_CLEANUP_DESTDIR="/srv/http/repo/private/${_name}/source-cleanup" SOURCE_CLEANUP_DRYRUN=false # Time in days to keep moved sourcepackages -SOURCE_CLEANUP_KEEP=30 +SOURCE_CLEANUP_KEEP=14 REQUIRE_SIGNATURE=true @@ -55,7 +40,9 @@ SRCEXT=".src.tar.gz" # Where to send error emails, and who they are from LIST="dev@lists.parabolagnulinux.org" -FROM="dbscripts+$(whoami)@$(hostname -f)" +FROM="dbscripts+${_name}@$(hostname -f)" # Override default config with config.local [ -f "$(dirname "${BASH_SOURCE[0]}")/config.local" ] && . "$(dirname "${BASH_SOURCE[0]}")/config.local" +[ -f "$(dirname "${BASH_SOURCE[0]}")/config.local.${_name}" ] && . "$(dirname "${BASH_SOURCE[0]}")/config.local.${_name}" +unset _name diff --git a/config.local.import-community b/config.local.import-community new file mode 100644 index 0000000..63f4d2f --- /dev/null +++ b/config.local.import-community @@ -0,0 +1,3 @@ +PKGREPOS=({community,multilib}{,-testing,-staging}) +PKGPOOL='pool/community' +SRCPOOL='sources/community' diff --git a/config.local.import-packages b/config.local.import-packages new file mode 100644 index 0000000..432b3ab --- /dev/null +++ b/config.local.import-packages @@ -0,0 +1,3 @@ +PKGREPOS=('core' 'extra' 'testing' 'staging' {kde,gnome}-unstable) +PKGPOOL='pool/packages' +SRCPOOL='sources/packages' diff --git a/config.local.parabola b/config.local.parabola new file mode 100644 index 0000000..2c52977 --- /dev/null +++ b/config.local.parabola @@ -0,0 +1,8 @@ +PKGREPOS=( + libre{,-testing} + libre-multilib{,-testing} + pcr kernels cross java nonprism + '~smv' '~xihh' '~brendan' '~lukeshu' '~emulatorman' '~aurelien' '~jorginho' '~coadde' '~drtan' +) +PKGPOOL='pool/parabola' +SRCPOOL='sources/parabola' diff --git a/create-repo b/create-repo deleted file mode 100755 index 3feb098..0000000 --- a/create-repo +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Creates repository structure - -. "$(dirname "$(readlink -e "$0")")/config" -. "$(dirname "$(readlink -e "$0")")/db-functions" - -if [ $# -eq 0 ]; then - msg "Usage: %s repo1 [repo2 ... repoX]" "${0##*/}" - exit 1 -fi - -msg "Creating repos..." -for _repo in "$@"; do - msg2 "Creating [%s]" "${_repo}" - for _arch in "${ARCHES[@]}"; do - mkdir -p "${FTP_BASE}/${_repo}/os/${_arch}" || \ - error "Failed creating %s dir" "${_arch}" - done -done - -msg "Don't forget to add them to the PKGREPOS array on %s" "$(dirname "$(readlink -e "$0")")/config" diff --git a/check-package-libraries.py b/db-check-package-libraries.py index bc2349b..bc2349b 100755 --- a/check-package-libraries.py +++ b/db-check-package-libraries.py @@ -4,5 +4,3 @@ source "$(dirname "$(readlink -e "$0")")/config" mkdir -p -- "${FTP_BASE}"/{"${PKGPOOL}","${SRCPOOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" - -"$(dirname "$(readlink -e "$0")")/create-repo" "${PKGREPOS[@]}" diff --git a/list_nonfree_in_db.py b/db-list-nonfree.py index 4e1b164..4e1b164 100755 --- a/list_nonfree_in_db.py +++ b/db-list-nonfree.py @@ -1,15 +0,0 @@ -#!/bin/bash -# Author: Nicolás Reynolds <fauno@kiwwwi.com.ar> -# License: GPLv3+ -# Description: A script to quickly create new [repos] - -source "$(dirname "$(readlink -e "$0")")/config" - -for repo in "$@"; do - echo ":: Creating [$repo]" - for arch in "${ARCHES[@]}"; do - mkdir -pv "${FTP_BASE}/${repo}/os/${arch}" - done -done - -echo ":: All done. Add the repo to the ParabolaWeb admin page." diff --git a/testing2x b/testing2x deleted file mode 100755 index b76438b..0000000 --- a/testing2x +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -. "$(dirname "$(readlink -e "$0")")/config" -. "$(dirname "$(readlink -e "$0")")/db-functions" - -if [ $# -lt 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 - if [ ! -d "${WORKDIR}/${pkgbase}" ]; then - found_source=false - for pkgarch in "${ARCHES[@]}" 'any'; do - xbsrepo_from="$(xbs releasepath "${pkgbase}" "${TESTING_REPO}" "${pkgarch}")" - if [ -r "${xbsrepo_from}/PKGBUILD" ]; then - found_source=true - break - fi - done - "${found_source}" || die "%s not found in [%s]" "${pkgbase}" "${TESTING_REPO}" - found_target=false - for pkgarch in "${ARCHES[@]}" 'any'; do - for repo in "${STABLE_REPOS[@]}"; do - xbsrepo_to="$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" - if [ -r "${xbsrepo_to}/PKGBUILD" ]; then - found_target=true - pkgs[${repo}]+="${pkgbase} " - break 2 - fi - done - done - "${found_target}" || die "%s not found in any of these repos: %s" "${pkgbase}" "${STABLE_REPOS[*]}" - fi -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 |