#!/bin/sh

set -e

file=$1

export TEXTDOMAIN=kcm_mobile_update_scripts
. gettext.sh

# in another directory, the path in gossum will be different
cd ~/update

# only hash without path to file
correct_sum=$(cat $file.gost | cut -d' ' -f1)
sum=$(gostsum ./$file | cut -d' ' -f1)

if [ $correct_sum = $sum ]; then
	echo $(gettext "gostsum is correct")
else
	echo $(gettext "gostsum incorrent!") >&2
	exit 1
fi
