[Debian-l10n-commits] r1141 - in /ddtp-dinstall/trunk: Changelog ddtp_i18n_check.sh
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Sat Aug 9 02:58:55 UTC 2008
Author: nekral-guest
Date: Sat Aug 9 02:58:54 2008
New Revision: 1141
URL: http://svn.debian.org/wsvn/?sc=1&rev=1141
Log:
Thanks for the patience of Felipe Augusto van de Wiel and Michael
Bramer.
* ddtp_i18n_check.sh: Add indication and date in case of success
* ddtp_i18n_check.sh: Move the diff | grep inside the if (failures
caused the script to exit).
* ddtp_i18n_check.sh: Add slashes to match suite name more
strictly.
* ddtp_i18n_check.sh: Run the script in C locale.
* ddtp_i18n_check.sh: Enhance the error messages from the
has_valid_fields() function.
Added:
ddtp-dinstall/trunk/Changelog
Modified:
ddtp-dinstall/trunk/ddtp_i18n_check.sh
Added: ddtp-dinstall/trunk/Changelog
URL: http://svn.debian.org/wsvn/ddtp-dinstall/trunk/Changelog?rev=1141&op=file
==============================================================================
--- ddtp-dinstall/trunk/Changelog (added)
+++ ddtp-dinstall/trunk/Changelog Sat Aug 9 02:58:54 2008
@@ -1,0 +1,16 @@
+2008-08-08 Nicolas François <nicolas.francois at centraliens.net>
+
+ Thanks for the patience of Felipe Augusto van de Wiel and Michael
+ Bramer.
+ * ddtp_i18n_check.sh: Add indication and date in case of success
+ * ddtp_i18n_check.sh: Move the diff | grep inside the if (failures
+ caused the script to exit).
+ * ddtp_i18n_check.sh: Add slashes to match suite name more
+ strictly.
+ * ddtp_i18n_check.sh: Run the script in C locale.
+ * ddtp_i18n_check.sh: Enhance the error messages from the
+ has_valid_fields() function.
+
+2008-08-08 Nicolas François <nicolas.francois at centraliens.net>
+
+ Initial release.
Modified: ddtp-dinstall/trunk/ddtp_i18n_check.sh
URL: http://svn.debian.org/wsvn/ddtp-dinstall/trunk/ddtp_i18n_check.sh?rev=1141&op=diff
==============================================================================
--- ddtp-dinstall/trunk/ddtp_i18n_check.sh (original)
+++ ddtp-dinstall/trunk/ddtp_i18n_check.sh Sat Aug 9 02:58:54 2008
@@ -12,6 +12,7 @@
# /usr/share/common-licenses/GPL-2
set -e
+export LC_ALL=C
# This must be defined to either 0 or 1
# When DEBUG=0, fail after the first error.
@@ -102,6 +103,9 @@
hvf_lang=${hvf_file/*-}
awk "
+function print_status () {
+ printf (\"p: %d, m: %d, s: %d, l: %d\n\", package, md5, s_description, l_description)
+}
BEGIN {
package = 0 # Indicates if a Package field was found
md5 = 0 # Indicates if a Description-md5 field was found
@@ -118,7 +122,8 @@
|| (0 != md5) \
|| (0 != s_description) \
|| (0 != l_description)) {
- printf (\"Wrong fields ordering in $hvf_file (line %d)\n\", NR)
+ printf (\"Package field unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
@@ -134,7 +139,8 @@
|| (0 != md5) \
|| (0 != s_description) \
|| (0 != l_description)) {
- printf (\"Wrong fields ordering in $hvf_file (line %d)\n\", NR)
+ printf (\"Description-md5 field unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
@@ -150,7 +156,8 @@
|| (1 != md5) \
|| (0 != s_description) \
|| (0 != l_description)) {
- printf (\"Wrong fields ordering in $hvf_file (line %d)\n\", NR)
+ printf (\"Description-$hvf_lang field unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
@@ -165,7 +172,8 @@
if ( (1 != package) \
|| (1 != md5) \
|| (1 != s_description)) {
- printf (\"Wrong fields ordering in $hvf_file (line %d)\n\", NR)
+ printf (\"Long description unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
@@ -182,7 +190,9 @@
|| (1 != md5) \
|| (1 != s_description) \
|| (1 != l_description)) {
- printf (\"Fields missing in $hvf_file (line %d)\n\", NR)
+ printf (\"End of block unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
+ failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
}
@@ -197,23 +207,27 @@
# Anything else: fail
{
- printf (\"Invalid field \$0 in $hvf_file (line %d)\n\", NR)
+ printf (\"Unexpected line '\$0' in $hvf_file (line %d)\n\", NR)
+ print_status()
failed = 1
if ($DEBUG) { failures++ } else { exit 1 }
}
END {
- # They must be all set to 0 or all set to 1
- if ( ( (0 == package) \
- || (0 == md5) \
- || (0 == s_description) \
- || (0 == l_description)) \
- && ( (0 != package) \
- || (0 != md5) \
- || (0 != s_description) \
- || (0 != l_description))) {
- printf (\"Fields missing in $hvf_file (line %d)\n\", NR)
- exit 1
+ if (0 == failed) {
+ # They must be all set to 0 or all set to 1
+ if ( ( (0 == package) \
+ || (0 == md5) \
+ || (0 == s_description) \
+ || (0 == l_description)) \
+ && ( (0 != package) \
+ || (0 != md5) \
+ || (0 != s_description) \
+ || (0 != l_description))) {
+ printf (\"End of file unexpected in $hvf_file (line %d)\n\", NR)
+ print_status()
+ exit 1
+ }
}
if (failures > 0) {
@@ -259,12 +273,11 @@
# Check that every packages in Translation-$lang exists
grep "^Package: " $f | cut -d' ' -f 2 | sort -u > $PACKAGES_LISTS_DIR/tmp.pkgs
case "$f" in
- "*$STABLE*") t="$STABLE";;
- "*$TESTING*") t="$TESTING";;
- "*$UNSTABLE*") t="$UNSTABLE";;
+ */$STABLE/*) t="$STABLE";;
+ */$TESTING/*) t="$TESTING";;
+ */$UNSTABLE/*) t="$UNSTABLE";;
esac
- diff $PACKAGES_LISTS_DIR/$t.pkgs $PACKAGES_LISTS_DIR/tmp.pkgs | grep -q -m1 "^>"
- if [ "$?" != "0" ]; then
+ if diff $PACKAGES_LISTS_DIR/$t.pkgs $PACKAGES_LISTS_DIR/tmp.pkgs | grep -q "^>"; then
rm -f $PACKAGES_LISTS_DIR/tmp.pkgs
echo "$f contains packages which are not in $t" >&2
exit 1
@@ -292,3 +305,5 @@
fi
done
+echo "$dists_parent_dir structure validated successfully ($(date +%c))"
+
More information about the Debian-l10n-commits
mailing list