[Debian-l10n-commits] r1166 - in /ddtp-dinstall/trunk: Changelog checks/ddtp_dinstall.sh

faw at users.alioth.debian.org faw at users.alioth.debian.org
Mon Aug 11 04:57:23 UTC 2008


Author: faw
Date: Mon Aug 11 04:57:20 2008
New Revision: 1166

URL: http://svn.debian.org/wsvn/?sc=1&rev=1166
Log:
* checks/ddtp_dinstall.sh: Added script to atomically rotate
  directories to DAK.

Added:
    ddtp-dinstall/trunk/checks/ddtp_dinstall.sh   (with props)
Modified:
    ddtp-dinstall/trunk/Changelog

Modified: ddtp-dinstall/trunk/Changelog
URL: http://svn.debian.org/wsvn/ddtp-dinstall/trunk/Changelog?rev=1166&op=diff
==============================================================================
--- ddtp-dinstall/trunk/Changelog (original)
+++ ddtp-dinstall/trunk/Changelog Mon Aug 11 04:57:20 2008
@@ -1,3 +1,8 @@
+2008-08-11  Felipe Augusto van de Wiel  <faw at funlabs.org>
+
+	* checks/ddtp_dinstall.sh: Added script to atomically rotate
+	directories to DAK.
+
 2008-08-11  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* checks/ddtp_i18n_check.sh, tests/new_test_unit.sh,

Added: ddtp-dinstall/trunk/checks/ddtp_dinstall.sh
URL: http://svn.debian.org/wsvn/ddtp-dinstall/trunk/checks/ddtp_dinstall.sh?rev=1166&op=file
==============================================================================
--- ddtp-dinstall/trunk/checks/ddtp_dinstall.sh (added)
+++ ddtp-dinstall/trunk/checks/ddtp_dinstall.sh Mon Aug 11 04:57:20 2008
@@ -1,0 +1,56 @@
+#!/bin/bash -eu
+# 
+# $Id$
+#
+# Copyright (C) 2008, Felipe Augusto van de Wiel <faw at funlabs.org>
+# Copyright (C) 2008, Nicolas François <nicolas.francois at centraliens.net>
+#
+# 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.
+#
+# On Debian systems, you can find the full text of the license in
+# /usr/share/common-licenses/GPL-2
+
+TIMESTAMP=$(date +%Y%m%d_%H%M%S)
+
+DDTP_I18N_CHECK=/srv/scripts/ddtp_i18n_check.sh
+
+TRANSLATION_FILES=/srv/ddtp.debian.net/Translation-files
+PACKAGE_LISTS=/srv/ddtp.debian.net/packagelist
+DDTP_DINSTALL_DIR=/srv/ddtp-dinstall
+
+CHECK_DIR="$DDTP_DINSTALL_DIR/tf.check"
+OLD_TARGET=$(readlink "$DDTP_DINSTALL_DIR/to-dak")
+TMP_LINK="$DDTP_DINSTALL_DIR/to-dak-tmp"
+DAK_LINK="$DDTP_DINSTALL_DIR/to-dak"
+
+for d in "$TRANSLATION_FILES" "$PACKAGE_LISTS"; do
+	if [ ! -d "$d" ]; then
+		echo "Invalid directory '$d'"
+		exit 1
+	fi
+done
+
+# A new process :-)
+cd "$DDTP_DINSTALL_DIR"
+
+# Clean the check directory to prepare a new one
+rm -rf "$CHECK_DIR"
+cp -a "$TRANSLATION_FILES" "$CHECK_DIR"
+$DDTP_I18N_CHECK "$CHECK_DIR" "$PACKAGE_LISTS"
+rm -rf "$CHECK_DIR"
+
+# Copy the new Translation files and create the new symlink
+cp -a "$TRANSLATION_FILES" "$DDTP_DINSTALL_DIR/tf.$TIMESTAMP"
+ln -s "$DDTP_DINSTALL_DIR/tf.$TIMESTAMP" "$TMP_LINK"
+
+# Atomic change the files seen by dak
+mv -fT "$TMP_LINK" "$DAK_LINK"
+
+# Only try to removes $OLD_TARGET if it exists
+if [ -d "$OLD_TARGET" ]; then
+	rm -rf "$OLD_TARGET"
+fi
+

Propchange: ddtp-dinstall/trunk/checks/ddtp_dinstall.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: ddtp-dinstall/trunk/checks/ddtp_dinstall.sh
------------------------------------------------------------------------------
    svn:keywords = Id




More information about the Debian-l10n-commits mailing list