summaryrefslogtreecommitdiff
path: root/db-import-src-archlinux
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 13:49:03 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 13:49:03 -0400
commita4fb5765c0fe8f6d03985d5375b09c0cd68903f2 (patch)
tree654a6c0595205f6fc0eff51ef9139f2e53b573d5 /db-import-src-archlinux
parentf0e4cdbb1ae4d36b5555baeaf420d83258b3003d (diff)
switch up the naming schem for the import scripts
Diffstat (limited to 'db-import-src-archlinux')
-rwxr-xr-xdb-import-src-archlinux124
1 files changed, 0 insertions, 124 deletions
diff --git a/db-import-src-archlinux b/db-import-src-archlinux
deleted file mode 100755
index 72171f1..0000000
--- a/db-import-src-archlinux
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/bash
-
-set -e
-
-FTP_BASE=/srv/repo/main
-ABSLIBRE=/srv/abslibre
-ABSGIT=/srv/git/abslibre/abslibre.git
-# Remote
-# ABSGIT=http://projects.parabolagnulinux.org/abslibre.git
-BLACKLIST=/home/repo/blacklist/blacklist.txt
-SYNCARGS='-mrtv --no-motd --delete-after --no-p --no-o --no-g --quiet'
-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
-
- # fix some permissions
- find "${ABSROOT}" -type d -print0 | xargs -0 chmod 755
- find "${ABSROOT}" -type f -print0 | xargs -0 chmod 644
-}
-
-function get_blacklist() {
- printf ":: Updating blacklist...\t"
- cat "${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
- rm -rf /tmp/abslibre
- git clone "$ABSGIT" /tmp/abslibre
-
- # 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 --quiet --exclude=.git/ /tmp/abslibre/ ${ABSLIBRE}/${ARCH}/; done) || {
- printf "[FAILED]\n"
- return 1
- }
-
- # fix some permissions
- find "${ABSLIBRE}" -type d -print0 | xargs -0 chmod 755
- find "${ABSLIBRE}" -type f -print0 | xargs -0 chmod 644
-
- 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 $FTP_BASE/$baserepo/os/$arch/
- rm -fv $FTP_BASE/$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 -czf $FTP_BASE/$baserepo/os/$arch/$baserepo.abs.tar.gz \
- -s ":${ABSLIBRE}/[a-z0-9_]\+/[a-z]\+::" \
- $repo/* ${ABSLIBRE}/any/${baserepo}/*
-
- done
-}
-
-sync_abs
-get_blacklist
-sync_abs_libre
-#sync_pre_mips64el
-create_tarballs