[Debian-l10n-commits] r1017 - in /pkg-ddtp-translations: ./ README branches/ tags/ trunk/ trunk/byhand-ddtp trunk/create-pkg trunk/debian/ trunk/debian/changelog trunk/debian/control trunk/generate-translations-tarball.sh

faw at users.alioth.debian.org faw at users.alioth.debian.org
Fri Jan 11 17:45:54 UTC 2008


Author: faw
Date: Fri Jan 11 17:45:54 2008
New Revision: 1017

URL: http://svn.debian.org/wsvn/?sc=1&rev=1017
Log:
* Adding pkg-ddtp-translations, the module that is supposed to hold all
  the resources and scripts related to the autobyhand approach for the
  ddtp-translations package

  - debian/
	This directory should help keep track of our changelog

  - generate-translations-tarball.sh 
  	This runs in i18n.d.n and creates the tarballs used by create-pkg

  - create-pkg
  	Makes a small build environment to generate the necessary files to
	upload the ddtp-translations package.

  - byhand-ddtp
  	The first prototype of the script that should run on archive side
	to verify the package in the autobyhand process before install the
	new translations

Added:
    pkg-ddtp-translations/
    pkg-ddtp-translations/README
    pkg-ddtp-translations/branches/
    pkg-ddtp-translations/tags/
    pkg-ddtp-translations/trunk/
    pkg-ddtp-translations/trunk/byhand-ddtp   (with props)
    pkg-ddtp-translations/trunk/create-pkg   (with props)
    pkg-ddtp-translations/trunk/debian/
    pkg-ddtp-translations/trunk/debian/changelog
    pkg-ddtp-translations/trunk/debian/control
    pkg-ddtp-translations/trunk/generate-translations-tarball.sh   (with props)

Added: pkg-ddtp-translations/README
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/README?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/README (added)
+++ pkg-ddtp-translations/README Fri Jan 11 17:45:54 2008
@@ -1,0 +1,13 @@
+pkg-ddtp-translations
+----------------------------------------------------------------------
+
+This is the set of scripts and files to generate the package to upload
+Translation-* files to ftp-master to be processed by the autobyhand.
+
+The idea is to make it easier and consistent, keeping the history of
+changelogs and uploads under SVN. It also keeps track of the byhand
+script used on the archive to process the new packages and check if
+they are "valid".
+
+					-- Felipe Augusto van de Wiel (faw)
+					  			   20071218

Added: pkg-ddtp-translations/trunk/byhand-ddtp
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/trunk/byhand-ddtp?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/trunk/byhand-ddtp (added)
+++ pkg-ddtp-translations/trunk/byhand-ddtp Fri Jan 11 17:45:54 2008
@@ -1,0 +1,73 @@
+#!/bin/sh -ue
+# Based on byhand-tags
+
+# Tarball to unpack
+TBALL="${1:?"Usage: ${0} <filename>"}"
+
+# Check the 
+
+# Where to move the Translation files (FIXME)
+DESTDIR=/srv/ftp.debian.org/
+
+# Check the structure of the tarball
+FILES=$(tar tzf "${TBALL}")
+
+for f in ${FILES}; do
+	if [ "D${f}" = "Dmain/" -o "D${f}" = "Dmain/i18n/" ]; then
+		continue;
+	fi
+
+	# Check top level directory
+	D1=$(echo ${f} |cut -d'/' -f1);
+	if [ "D${D1}" != "Dmain" ]; then
+		echo "Wrong top directory, should be ./main/ (${f})"
+		exit 1
+	fi
+	D2=$(echo ${f} |cut -d'/' -f2);
+	if [ "D${D2}" != "Di18n" ]; then
+		echo "Wrong directory structure, should be ./main/i18n/ (${f})"
+		exit 1
+	fi
+
+	FN=$(echo ${f} |cut -d'/' -f3);
+	# FN should be Translation-xx_YY, so we will split it to check if the
+	# name are correctly
+	FNT=$(echo ${FN} |cut -d'-' -f1);
+	FNL=$(echo ${FN} |cut -d'-' -f2);
+	
+	# Check if it is called 'Translation'
+	if [ "D${FNT}" != "DTranslation" ]; then
+		echo "Wrong filename, it should be Translation-xx_YY (${FN})"
+		exit 1
+	fi
+	
+	# Check if it is called 'Translation'
+	LANGRE='^[a-z]{2,3}(_[A-Z]{2})?$'
+	echo ${FNL} |grep -E "${LANGRE}" > /dev/null
+
+	# 0: It works
+	# 1: It fails
+	if [ $? -eq 1 ]; then
+		echo "Wrong language name, it should be xx_YY (${FN})"
+		exit 1
+	fi
+done
+
+umask 002
+TEMPDIR=$(mktemp -d -p ./ ddtp.XXXXXXXX);
+
+cleanup() {
+	rm -rf "${TEMPDIR}"
+}
+trap cleanup EXIT
+
+tar xzf "${TBALL}" -C "${TEMPDIR}"
+ZFILES=$(find ${TEMPDIR} -size 0)
+if [ ! -z "${ZFILES}" ]; then
+	echo "Ooops, files with zero bytes not allowed!"
+	echo "${ZFILES}"
+	exit 1
+fi
+
+trap - EXIT
+exit 0

Propchange: pkg-ddtp-translations/trunk/byhand-ddtp
------------------------------------------------------------------------------
    svn:executable = *

Added: pkg-ddtp-translations/trunk/create-pkg
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/trunk/create-pkg?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/trunk/create-pkg (added)
+++ pkg-ddtp-translations/trunk/create-pkg Fri Jan 11 17:45:54 2008
@@ -1,0 +1,99 @@
+#!/bin/sh
+# Copyright Felipe Augusto van de Wiel (faw) <faw at debian.org>, 2007.
+# Licenced under the terms of the GNU/GPLv2 or later, at your choice.
+
+# This scripts prepares the Translation files to be uploaded to the
+# AUTO-BYHAND queue, right now it takes care of properly generate the
+# structure using standard tools, in the future it should implement
+# various tests to make sure that the Translation-* files are OK!
+
+### TODO
+# * Add an option to avoid updating from SVN
+# * Add an option to avoid committing to SVN
+# * Add an option don't clean the build
+# * Add an option to automatically download the new translation package
+# * Add checks during the build phase to check the translation tarball
+
+# TarBall with translations
+#  Note that it must use i18n.d.n format, otherwise it will not generate
+#  a correct final package
+if [ -z "${1}" ]; then
+	echo "Use: ${0} <ddtp-translations-YYYYMMDD-HHMMss.tar.gz>"
+	exit 1
+else
+	TARBALL=${1}
+fi
+
+# Trap to cleanup the mess if something goes wrong
+cleanup() {
+	cd "${START_DIR}"
+	rm -rf "${PKG_DIR}"
+}
+trap cleanup EXIT
+
+# Directory from where everything began
+START_DIR=$(pwd)
+
+# TimeStamp
+TIMESTAMP=$(date +%Y%m%d.%H%M%S)
+
+# Name of the package
+PKG_NAME="ddtp-translations"
+
+# DDTP Release Version
+DDTP_VER=$(echo ${TARBALL} |cut -d'-' -f3 |cut -d'.' -f1)
+
+# Create the build directory
+BUILDDIR="${START_DIR}/build.${TIMESTAMP}"
+mkdir -p "${BUILDDIR}"
+
+# File to add info/logs about the build process
+LOG=${BUILDDIR}/build-${TIMESTAMP}.log
+
+# Create the "package" directory
+echo "Building the package directory... " |tee -a ${LOG}
+PKG_DIRNAME="${PKG_NAME}-${DDTP_VER}"
+PKG_DIR="${BUILDDIR}/${PKG_DIRNAME}"
+mkdir -p "${PKG_DIR}"
+tar -xzvf "${TARBALL}" -C "${PKG_DIR}" >> ${LOG} 2>&1
+
+# Once we got the directory, move debian/ inside
+#  It should be a SVN checkout and then SVN export
+cp -a debian "${PKG_DIR}"
+
+# Alter the debian/changelog
+#echo "Automatically updating debian/changelog... " |tee -a ${LOG}
+#cd "${PKG_DIR}"
+#dch -d "Updating DDTP translations (${DDTP_VER})."
+#cd -
+
+# Name of the package
+PKG_VER=$(head -1 ${PKG_DIR}/debian/changelog |cut -d'(' -f2 |cut -d')' -f1)
+PKG_FILE="${PKG_NAME}_${PKG_VER}_all.tar.gz"
+
+# Build the "package" 
+echo "Building the package..." |tee -a ${LOG}
+tar -czvf "${BUILDDIR}/${PKG_FILE}" -C "${PKG_DIR}" main/ >> ${LOG} 2>&1
+
+# Generate debian/files
+cd "${PKG_DIR}"
+dpkg-distaddfile "${PKG_FILE}" raw-translations -
+
+# Generate the .dsc
+cd "${BUILDDIR}"
+dpkg-source -b "${PKG_DIRNAME}"
+rm ${PKG_NAME}_${PKG_VER}.tar.gz
+
+# Generate the .changes
+cd "${PKG_DIR}"
+PKG_DESC=$(echo; grep Description: ${PKG_DIR}/debian/control |cut -d: -f2-)
+
+dpkg-genchanges -B \
+	-DDescription="${PKG_DESC}" > ../${PKG_NAME}_${PKG_VER}_all.changes 
+cd "${START_DIR}"
+
+# Clean some of the mess
+rm -rf "${PKG_DIR}/debian/tmp"
+
+trap - EXIT
+exit 0

Propchange: pkg-ddtp-translations/trunk/create-pkg
------------------------------------------------------------------------------
    svn:executable = *

Added: pkg-ddtp-translations/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/trunk/debian/changelog?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/trunk/debian/changelog (added)
+++ pkg-ddtp-translations/trunk/debian/changelog Fri Jan 11 17:45:54 2008
@@ -1,0 +1,6 @@
+ddtp-translations (20080111-1) unstable; urgency=low
+
+  * First upload using autobyhand.
+  * Updating DDTP translations (20080111). (Closes: #431891).
+
+ -- Felipe Augusto van de Wiel (faw) <faw at debian.org>  Fri, 11 Jan 2008 15:06:50 -0200

Added: pkg-ddtp-translations/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/trunk/debian/control?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/trunk/debian/control (added)
+++ pkg-ddtp-translations/trunk/debian/control Fri Jan 11 17:45:54 2008
@@ -1,0 +1,12 @@
+Source: ddtp-translations
+Section: raw-translations
+Priority: optional
+Maintainer: Debian i18n Team <debian-i18n at lists.debian.org>
+Uploaders: Felipe Augusto van de Wiel (faw) <faw at debian.org>, Michael Bramer <grisu at debian.org>
+
+Package: ddtp-translations
+Section: raw-translations
+Architecture: all
+Description: translated descriptions of Debian packages 
+ This is the set of Translation-* files, coming from ddtp.debian.org. It is
+ formatted in the archive layout to be added under i18n/ subdirectories.

Added: pkg-ddtp-translations/trunk/generate-translations-tarball.sh
URL: http://svn.debian.org/wsvn/pkg-ddtp-translations/trunk/generate-translations-tarball.sh?rev=1017&op=file
==============================================================================
--- pkg-ddtp-translations/trunk/generate-translations-tarball.sh (added)
+++ pkg-ddtp-translations/trunk/generate-translations-tarball.sh Fri Jan 11 17:45:54 2008
@@ -1,0 +1,16 @@
+#!/bin/bash
+# Copyright (C) 2007 Felipe Augusto van de Wiel (faw) <faw at debian.org>
+# Licensed under the terms of the GNU/GPLv2 or later
+
+TRANSLATIONS_SID=/var/www/ddtp/debian/dists/sid
+
+TARBALL_DIR=/var/www/ddtp/tarballs
+TARBALL_FILE=ddtp-translations-$(date +%Y%m%d.%H%M%S).tar.gz
+
+tar -C "${TRANSLATIONS_SID}" -czf "${TARBALL_DIR}/${TARBALL_FILE}" \
+        $(find "${TRANSLATIONS_SID}" -name 'Translation-*' -printf '%P\n' |
+                grep -v ".bz2$" |
+                grep -v ".gz$")
+
+# Auto Cleanup
+find ${TARBALL_DIR} -daystart -mtime +90 -delete

Propchange: pkg-ddtp-translations/trunk/generate-translations-tarball.sh
------------------------------------------------------------------------------
    svn:executable = *




More information about the Debian-l10n-commits mailing list