summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-11-23 07:54:13 -0800
committerParabola <dev@list.parabolagnulinux.org>2011-11-23 07:54:13 -0800
commit9ef417865ef8b102875d42d4cb8ebe277de4ec01 (patch)
tree954c604efd308a82f7f4ed5f28be34c78c8678b2
parentce87644a79a5aad2c6f24695a2b142468d41d205 (diff)
Making it work
-rw-r--r--config2
-rwxr-xr-xdb-sync63
2 files changed, 36 insertions, 29 deletions
diff --git a/config b/config
index 7122aef..e0d474c 100644
--- a/config
+++ b/config
@@ -4,7 +4,7 @@ ARCH_BASE="/srv/http/repo/public"
SVNREPO="/var/abs"
# Repos from Arch
-ARCHREPOS=('core' 'testing' 'extra' 'community' 'multilib')
+ARCHREPOS=('core' 'testing' 'extra' 'community') # 'multilib')
# Official Parabola repos
OURREPOS=('libre' 'libre-testing')
# User repos
diff --git a/db-sync b/db-sync
index 1a9e02f..320a71d 100755
--- a/db-sync
+++ b/db-sync
@@ -18,13 +18,14 @@
# Returns contents of a repo
get_repos() {
+ mkdir -p ${TMPDIR}/${PID}.cache
# Exclude everything but db files
- rsync -avm --include="*/" \
+ rsync -vmrtlH --no-p --include="*/" \
--include="*.db" \
--include="*${DBEXT}" \
--exclude="*" \
--delete-after \
- rsync://${mirror}/${mirrorpath}/ cache/
+ rsync://${mirror}/${mirrorpath}/ ${TMPDIR}/${PID}.cache
}
get_repo_content() {
@@ -42,9 +43,9 @@ get_blacklist() {
# repo
# arch
get_repo_file() {
- [ ! -r "cache/${1}/os/${2}/${1}${DBEXT}" ] && return 1
+# shopt -s nullglob
- echo "cache/${1}/os/${2}/${1}${DBEXT}"
+ echo "${TMPDIR}/${PID}.cache/${1}/os/${2}/${1}${DBEXT}"
}
# Process the databases and get the libre packages
@@ -61,8 +62,8 @@ init() {
get_repos
# Traverse all repo-arch pairs
- for _arch in ${ARCHARCHES[@]}; do
- for _repo in ${ARCHREPOS[@]}; do
+ for _repo in ${ARCHREPOS[@]}; do
+ for _arch in ${ARCHARCHES[@]}; do
msg "Processing ${_repo}-${_arch}"
repo_file=$(get_repo_file ${_repo} ${_arch})
@@ -91,7 +92,6 @@ init() {
--delete-after \
--delete-excluded \
--delay-updates \
- --max-delete=1000 \
--include-from=/tmp/${_repo}-${_arch}.whitelist \
--exclude="*" \
rsync://${mirror}/${mirrorpath}/${_repo}/os/${_arch}/ \
@@ -100,17 +100,18 @@ init() {
# Add a new whitelist
whitelists+=(/tmp/${_repo}-${_arch}.whitelist)
+ msg "Putting databases back in place"
+ rsync -vrtlH \
+ --delay-updates \
+ --safe-links \
+ ${TMPDIR}/${PID}.cache/${_repo}/os/${_arch}/ \
+ ${FTP_BASE}/${_repo}/os/${_arch}/
+
# Cleanup
unset db
done
done
- msg "Putting databases back in place"
- rsync -vrtlH \
- --delay-updates \
- --safe-links \
- cache/ \
- ${FTP_BASE}/
msg "Syncing package pool"
# Concatenate all whitelists
@@ -121,13 +122,15 @@ init() {
# Sync
# *Don't delete-after*, this is the job of cleanup scripts. It will remove our
# packages too
- rsync -vrtlH \
- --delay-updates \
- --safe-links \
- --include-from=/tmp/any.whitelist \
- --exclude="*" \
- rsync://${mirror}/${mirrorpath}/${PKGPOOL}/ \
- ${FTP_BASE}/${PKGPOOL}/
+ for PKGPOOL in pool/packages pool/community extra/os/any community/os/any; do
+ rsync -vrtlH \
+ --delay-updates \
+ --safe-links \
+ --include-from=/tmp/any.whitelist \
+ --exclude="*" \
+ rsync://${mirror}/${mirrorpath}/${PKGPOOL}/ \
+ ${FTP_BASE}/${PKGPOOL}/
+ done
# Sync sources
msg "Syncing source pool"
@@ -137,13 +140,15 @@ init() {
# Sync
# *Don't delete-after*, this is the job of cleanup scripts. It will remove our
# packages too
- rsync -vrtlH \
- --delay-updates \
- --safe-links \
- --include-from=/tmp/any.whitelist \
- --exclude="*" \
- rsync://${mirror}/${mirrorpath}/${SRCPOOL}/ \
- ${FTP_BASE}/${SRCPOOL}/
+ for SRCPOOL in sources/packages sources/community ; do
+ rsync -vrtlH \
+ --delay-updates \
+ --safe-links \
+ --include-from=/tmp/any.whitelist \
+ --exclude="*" \
+ rsync://${mirror}/${mirrorpath}/${SRCPOOL}/ \
+ ${FTP_BASE}/${SRCPOOL}/
+ done
# Cleanup
@@ -153,7 +158,7 @@ init() {
trap_exit() {
echo
error "$@"
- exit 1
+ exit 1
}
@@ -169,3 +174,5 @@ trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
init
+
+rm -r ${TMPDIR}/${PID}.cache