}
function release() {
+ # XXX: disable once we can remove i18n/Index (#649314)
+ log "Generating i18n/Index"
+ (cd "$ftpdir/dists"; for dist in testing unstable; do $scriptsdir/generate-i18n-Index $dist; done)
+ (cd "$webdir/newdists/dists"; for dist in testing unstable; do $scriptsdir/generate-i18n-Index $dist; done)
log "Generating Release files"
dak generate-releases
# XXX: disable again later
# files.
DRY_RUN=0
-# When GEN_IDX=1, we create the Index files. There is a runtime option
-# to not create/generate the Index file.
-GEN_IDX=1
-
dists_parent_dir=""
# If no argument indicates the PACKAGES_LISTS_DIR then use '.'
PACKAGES_LISTS_DIR=""
echo " --debug Debug mode: do not stop after the first error" >&2
echo " --dry-run Do not generate the compressed version of the " >&2
echo " Translation files">&2
- echo " --no-index Do not generate the Index files" >&2
exit 1
}
"--dry-run")
DRY_RUN=1
;;
- "--no-index")
- GEN_IDX=0
- ;;
"-*")
usage
;;
if ! is_dirname_okay "$f"; then
echo "Wrong directory name: $f" >&2
exit 1
- else
- # If the directory name is OK, and if it's name is i18n
- # and GEN_IDX is enabled, we generate the header of the
- # Index file
- if [ "$(basename $f)" = "i18n" -a "$GEN_IDX" = "1" ];
- then
- echo "SHA1:" > "$f/Index"
- fi
fi
elif [ -f "$f" ]; then
# If $f is in $SPECIAL_FILES, we skip to the next loop because
# Now generate the compressed files
bzip2 "$f"
fi
-
- # Create Index
- if [ "$GEN_IDX" = "1" ]; then
- fbz=${f}.bz2
- IDX=$(dirname $f)
- tf_name=$(basename $fbz)
- tf_sha1=$(sha1sum $fbz)
- tf_size=$(du --bytes $fbz)
- printf ' %s % 7s %s\n' "${tf_sha1% *}" \
- "${tf_size% *}" "${tf_name}" >> "$IDX/Index"
- fi
else
echo "Neither a file or directory: $f" >&2
exit 1
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) 2011, 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.
+#
+# On Debian systems, you can find the full text of the license in
+# /usr/share/common-licenses/GPL-2
+
+set -eu
+export LC_ALL=C
+
+usage () {
+ echo "Usage: $0 <dist-directory>" >&2
+ exit 1
+}
+
+# Parse options
+if [ $# != 1 ] ; then
+ usage
+fi
+if [ ! -d "$1" ] ; then
+ echo "$1 does not exist or is not a directory." >&2
+ usage
+fi
+if [ ! -d "$1"/main/i18n ] ; then
+ echo "No main/i18n directory in $1." >&2
+ usage
+fi
+cd "$1/main/i18n"
+
+# If it's trapped, something bad happened.
+trap_exit () {
+ rm -f Index
+ exit 1
+}
+trap trap_exit EXIT HUP INT QUIT TERM
+
+exec 3>Index
+
+echo "SHA1:" >&3
+for file in Translation-* ; do
+ sha=$(sha1sum "$file"); sha="${sha%% *}"
+ size=$(du --bytes "$file"); size="${size%%[^0-9]*}"
+ printf ' %s % 7s %s\n' "$sha" "$size" "$file" >&3
+done
+
+exec 3>&-
+
+trap - EXIT