aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkeyboard-config/rules/merge.sh
blob: b18af7c3dc304f02a32a7570e0c3ea60be153751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

INDIR=`dirname $0`
DEST=$1
shift

if [ -z "$HDR" ]; then
    HDR="HDR"
fi

basename=`basename $0`
echo "// DO NOT EDIT THIS FILE - IT WAS AUTOGENERATED BY $basename FROM rules/*.part" >$DEST

for i in $*; do
  if [ "$i" = "$HDR" ] || [ "$i" = "HDR" ]; then
    echo >> $DEST;
    read hdr
    echo "$hdr" >> $DEST
  elif test -f $i; then
    cat $i >> $DEST || exit 1
  else
    cat $INDIR/$i >> $DEST || exit 1
  fi
done < $HDR