summaryrefslogtreecommitdiff
path: root/doc/gen-menus
blob: a3c728178dc49bef07bff467a863b33e183c739e (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
#!/bin/sh
#
# Regenerate menus.cfg files for themes from the master file
#
# 23 August 2001
# Michael Jennings <mej@eterm.org>
#
# (Consider this code public domain.  I don't care who does what with
# it.  It's not that significant.)  :-)
#

PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin
if [ "x$1" = "x-d" ]; then
  shift
  DIR=$1
  shift
fi

for i in "$@" ; do
    echo $i
    DEF=`echo $(basename $i) | tr '[a-z]' '[A-Z]'`
    m4 -D$DEF ${DIR:-.}/menu-master-file.m4 | perl -ne '/^\s*$/ || print;' > $i/menus.cfg
    chmod a+r,o-w $i/*.cfg
done