#!/bin/sh

# NOTE: not used by this package, but is used when working on the
# mp3splt and mp3splt-gtk packages. should only be used by me.

set -e

cp $1 $1.bak
echo cp $1.base $1
cp $1.base $1
FILE=$1
shift

while [ -n "$1" ]; do
    KEY=$(echo "$1" | awk -F= '{print $1}')
    VAL=$(echo "$1" | awk "{sub(\"$KEY=\", \"\", \$0); print}")
    echo sed -i "s/###$KEY###/$VAL/g" $FILE
    sed -i "s/###$KEY###/$VAL/g" $FILE
    shift
done
