]> err.no Git - dak/commitdiff
Export buildd queues to public location
authorAnsgar Burchardt <ansgar@debian.org>
Fri, 4 Jan 2013 12:08:56 +0000 (13:08 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 4 Jan 2013 12:11:56 +0000 (13:11 +0100)
The dists/ directory should be updated as atomic as possible. Therefore
buildds access a copy that can be updated with two file renames.

config/debian/apache.conf-incoming
config/debian/common
scripts/debian/update-buildd-archive [new file with mode: 0755]

index 480ce0f8f285024ba94caf6c2a248da151e75642..e1a65ed5d9ce0583bf0d683fb5e4556929331424 100644 (file)
@@ -20,7 +20,7 @@
   Alias /buildd-unstable /srv/incoming.debian.org/dists/unstable/current/
   Alias /buildd-experimental /srv/incoming.debian.org/dists/experimental/current/
 
-  <DirectoryMatch ~ "^/srv/(incoming\.debian\.org/(dists/|builddweb)|ftp\.debian\.org/mirror)">
+  <DirectoryMatch ~ "^/srv/(incoming\.debian\.org/(dists/|builddweb|debian-buildd/)|ftp\.debian\.org/mirror)">
     Order allow,deny
 
     Use DebianBuilddHostList
index 9accda153f2b15ba7a35ebf311dae2d82bf67eb6..c6f1c2d264807639807ac443e7cde307de0f5dc3 100644 (file)
@@ -36,6 +36,7 @@ function make_buildd_dir () {
     dak manage-build-queues -a
     dak generate-packages-sources2 -a build-queues
     dak generate-releases -a build-queues >/dev/null
+    ${scriptdir}/update-buildd-archive ${base}/build-queues ${incoming}/debian-buildd
 
     for suite in unstable experimental; do
         rm -rf "$incoming/dists/$suite/buildd"
diff --git a/scripts/debian/update-buildd-archive b/scripts/debian/update-buildd-archive
new file mode 100755 (executable)
index 0000000..a11b009
--- /dev/null
@@ -0,0 +1,68 @@
+#! /bin/bash
+#
+# Copyright 2012, Ansgar Burchardt <ansgar@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+set -u
+
+usage() {
+  echo "usage: $0 <source> <target>"
+  echo
+  echo "Update a minimalistic mirror for buildd archives."
+  exit ${1:-0}
+}
+
+if [ $# -ne 2 ]; then
+  usage 1
+fi
+
+source="${1}"
+dest="${2}"
+
+if [ ! -d "${source}/dists" -o ! -d "${source}/pool" ]; then
+  echo "${source}: does not look like a Debian archive" >&2
+  exit 1
+fi
+
+if [ ! -d "${dest}" ]; then
+  echo "${dest}: destination does not exist or is not a directory" >&2
+  exit 1
+fi
+
+# Make sure ${dest}/dists exists to avoid a special case later
+if [ ! -d "${dest}/dists" ]; then
+  mkdir "${dest}/dists"
+fi
+for olddir in dists.new dists.old; do
+  if [ -e "${dest}/${olddir}" ]; then
+    echo "Removing old ${olddir}..."
+    rm -r "${dest}/${olddir}"
+  fi
+done
+
+# Make sure ${dest}/pool exists
+if [ ! -e "${dest}/pool" ]; then
+  # Files are only removed from the build queues once they are no longer
+  # referenced. Having a symlink should thus not cause problems.
+  ln -s "${source}/pool" "${dest}/pool"
+fi
+
+# Finally copy dists/ to dists.new/, rename it and remove old version
+cp -a "${source}/dists" "${dest}/dists.new"
+mv "${dest}/dists" "${dest}/dists.old"
+mv "${dest}/dists.new" "${dest}/dists"
+rm -r "${dest}/dists.old"