File pre_checkin.sh of Package wxWidgets
#!/bin/bash
CANONICAL_NAME=wxWidgets
VARIANTS=("" -wxcontainer -ansi -wxcontainer24c)
for VAR in "${VARIANTS[@]}" ; do
NAME=$CANONICAL_NAME$VAR
if test $NAME = $CANONICAL_NAME ; then
continue
fi
if test $CANONICAL_NAME.spec -ot $NAME.spec ; then
echo "$CANONICAL_NAME.spec is older than $NAME.spec. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
if test $CANONICAL_NAME.changes -ot $NAME.changes ; then
echo "$CANONICAL_NAME.changes is older than $NAME.changes. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
sed "s/^Name: *$CANONICAL_NAME$/&$VAR/" <$CANONICAL_NAME.spec >$NAME.spec
cp -a $CANONICAL_NAME.changes $NAME.changes
done
touch $CANONICAL_NAME.spec $CANONICAL_NAME.changes
osc service localrun format_spec_file