~seb128/langpack-o-matic/import-extra-log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash -e

# this is part of langpack-o-matic
#
# (C) 2005 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@canonical.com>
#
# Build update packages for the release given as first argument; stable-updates
# will be uploaded to PPA, devel release will be uploaded straight into the
# Ubuntu archive.

release="$1"
[ -n "$release" ] || {
    echo "Usage: $0 <release>" >&2
    exit 1
}

unset LANG

cd $(dirname $0)

if test -s updated-packages; then
    echo "updated-packages is nonzero, please clean up first" >&2
    exit 1
fi

TAR=ubuntu-${release%-*}-translations-update.tar.gz
rm -f $TAR
wget --no-check-certificate -q -O $TAR https://translations.launchpad.net/ubuntu/${release%-*}/+latest-delta-language-pack
test -e $TAR || {
    echo "Could not download $TAR" >&2
    exit 1
}

mkdir -p ../logs ../${release/updates/proposed}
./import --update --treshold=5 -v $TAR ${release/updates/proposed} ../${release/updates/proposed} > ../logs/$release.log 2>&1

if [ "${release%-updates}" = "$release" ]; then
    # development release, upload straight to archive
    target=""
else
    # stable releases, upload to PPA
    target="ppa"
fi

./packages upload $target > ../logs/$release-upload.log 2>&1
rm $TAR