#!/bin/sh -eu

# Check for mistakes in tarball distribution

# Make sure all po files are valid
find $1/po -name '*.po' -print | while read file; do
    if ! msgfmt "$file" -o /dev/null; then
        echo "Refusing to distribute invalid po file: $file" >&2
        exit 1
    fi
done

# Validate our AppStream metadata
find $1 -name '*.metainfo.xml' -o -name '*.appdata.xml' | xargs appstream-util validate
