Skip to content

Commit

Permalink
Add OTA build script
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Nov 1, 2023
1 parent e7173a5 commit f6244f2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/build-ota-translations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -e

DESTDIR="ota-update-$$"
rm -rf "$DESTDIR"
mkdir -p "$DESTDIR"
function finish {
rm -rf "$DESTDIR"
}
trap finish EXIT

# compile PO files, taking care to make them reproducible, i.e. not change if the actual
# translations didn't change:
for po in locales/*.po ; do
mo="$(basename "$po" .po).mo"
mogz="$mo.gz"
printf "%-30s" "$po"

sed -e 's/^"PO-Revision-Date: .*/"PO-Revision-Date: \\n"/g' "$po" | msgfmt -c -o "$DESTDIR/$mo" -
gzip --no-name -9 "$DESTDIR/$mo"

size=$(ls -ks "$DESTDIR/$mogz" | cut -d' ' -f1)
printf "%'3d kB %s\n" "$size" "$(cd $DESTDIR && md5sum $mogz)"
done

# create a tarball of all updates:
tar -C "$DESTDIR" -cf ota-update.tar .

0 comments on commit f6244f2

Please sign in to comment.