lib/Tools/fixdatatype
author wenzelm
Fri Sep 01 17:50:36 2000 +0200 (2000-09-01)
changeset 9788 df671fa2562a
parent 6082 590f9e3bf4d8
child 10511 efb3428c9879
permissions -rwxr-xr-x
GPLed;
more robust handling of spaces in args / file names;
berghofe@5213
     1
#!/bin/bash
berghofe@5213
     2
#
berghofe@5213
     3
# $Id$
wenzelm@9788
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm@9788
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
berghofe@5213
     6
#
berghofe@5213
     7
# DESCRIPTION: adapt theories and proof scripts to new datatype package
berghofe@5213
     8
berghofe@5213
     9
berghofe@5213
    10
## diagnostics
berghofe@5213
    11
wenzelm@9788
    12
PRG=$(basename "$0")
berghofe@5213
    13
berghofe@5213
    14
function usage()
berghofe@5213
    15
{
berghofe@5213
    16
  echo
berghofe@5213
    17
  echo "Usage: $PRG [FILES|DIRS...]"
berghofe@5213
    18
  echo
berghofe@5213
    19
  echo "  Recursively find .thy/.ML files, adapting them to"
berghofe@5213
    20
  echo "  the new datatype package"
berghofe@5213
    21
  echo
berghofe@5213
    22
  echo "  Renames old versions of FILES by appending \"~~\"."
berghofe@5213
    23
  echo
berghofe@5213
    24
  exit 1
berghofe@5213
    25
}
berghofe@5213
    26
berghofe@5213
    27
berghofe@5213
    28
## process command line
berghofe@5213
    29
wenzelm@9788
    30
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
berghofe@5213
    31
wenzelm@9788
    32
SPECS="$@"; shift "$#"
berghofe@5213
    33
berghofe@5213
    34
berghofe@5213
    35
## main
berghofe@5213
    36
wenzelm@6082
    37
#set by configure
wenzelm@6082
    38
AUTO_PERL=perl
wenzelm@6082
    39
berghofe@5213
    40
find $SPECS \( -name \*.thy -o -name \*.ML \) -print | \
wenzelm@9788
    41
  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixdatatype.pl"