#!/bin/sh

echo -e "\
/* this is a placeholder so that xgettext can find the translatable
 * strings. This file is automatically generated, look at
 * ./create_placeholder
 */
char *foobar[] = { " > placeholder.h.$$
cat ../urpmf | perl -ne 's/.*\$ECHO\s+(".*").*/N_($1),/g and print' >> placeholder.h.$$

for i in $* 
do
	./pl_create_placeholder $i >> placeholder.h.$$
done

echo "};" >> placeholder.h.$$

# diff returns true if files are equal
if ! diff placeholder.h.$$ placeholder.h > /dev/null 2> /dev/null
then
	cat placeholder.h.$$ > placeholder.h
fi
rm -f placeholder.h.$$