| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | #!/bin/sh -e# Update po files using launchpad-export.tar.gzWORK_DIR=launchpad-workINPUT_TGZ=$1PO_DIR=poif [ -z "$INPUT_TGZ" ]; then    echo "Usage: import-po /path/to/launchpad-export.tar.gz"    echo "Specify input launchpad-export.tar.gz file"    exit 1fiif [ ! -e "$INPUT_TGZ" ]; then    echo "Input file $INPUT_TGZ does not exist"    exit 1fiif [ -e "$WORK_DIR" ]; then    rm -rf "$WORK_DIR"fimkdir "$WORK_DIR"echo "Extracting po files from the archive..."tar -x -C "$WORK_DIR" -f "$INPUT_TGZ"echo "Renaming po files..."# The directory structure of launchpad-export.tar.gz is a bit# strange. It even contains absolute file path. We first gather all# files in top level directory.mv "$WORK_DIR"/aria2/*.po "$WORK_DIR"echo -n "en@quot en@boldquot" > "$PO_DIR"/LINGUASfor file in "$WORK_DIR"/*.po; do    # First remove useless '\r' in messages    sed -i -e 's/\\r//' "$file"    bn=`basename "$file"`    bn=${bn#aria2-}    dst="$PO_DIR"/"$bn"    # copy file to po directory    echo "Moving \`$file' to \`$dst'..."    mv "$file" "$dst"    # Upate LINGUAS here too.    echo -n " ${bn%.po}" >> "$PO_DIR"/LINGUASdonerm -rf "$WORK_DIR"cd "$PO_DIR"make update-po
 |