+# When DRY_RUN=0, generate the compressed version of the Translation-*
+# files.
+DRY_RUN=0
+
+dists_parent_dir=""
+# If no argument indicates the PACKAGES_LISTS_DIR then use '.'
+PACKAGES_LISTS_DIR=""
+
+usage () {
+ echo "Usage: $0 [options] <dists_parent_dir> [<packages_lists_directory>]" >&2
+ echo "" >&2
+ 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
+ exit 1
+}
+
+# Parse options
+for opt; do
+ case "$opt" in
+ "--debug")
+ DEBUG=1
+ ;;
+ "--dry-run")
+ DRY_RUN=1
+ ;;
+ "-*")
+ usage
+ ;;
+ "")
+ echo "Empty parameter" >&2
+ echo "" >&2
+ usage
+ ;;
+ *)
+ if [ -z "$dists_parent_dir" ]; then
+ # Removing trailing /
+ dists_parent_dir=${opt%/}
+ elif [ -z "$PACKAGES_LISTS_DIR" ]; then
+ PACKAGES_LISTS_DIR=$opt
+ else
+ echo "$0: Invalid option: $opt" >&2
+ usage
+ fi
+ ;;
+ esac
+done
+PACKAGES_LISTS_DIR=${opt:-.}
+
+if [ ! -d "$dists_parent_dir" ]; then
+ echo "missing dists_parent_dir, or not a directory" >&2
+ echo "" >&2
+ usage
+elif [ ! -d "$PACKAGES_LISTS_DIR" ]; then
+ echo "missing packages_lists_directory, or not a directory" >&2
+ echo "" >&2
+ usage
+fi
+