lib/Tools/fixcpure
changeset 15800 f2215ed00438
child 15847 c05c7670f166
equal deleted inserted replaced
15799:50989ffdcdda 15800:f2215ed00438
       
     1 #!/usr/bin/env bash
       
     2 #
       
     3 # $Id$
       
     4 # Author: Makarius
       
     5 #
       
     6 # DESCRIPTION: adapt theories and ML files to new CPure/Pure arrangement
       
     7 
       
     8 
       
     9 ## diagnostics
       
    10 
       
    11 PRG="$(basename "$0")"
       
    12 
       
    13 function usage()
       
    14 {
       
    15   echo
       
    16   echo "Usage: $PRG [FILES|DIRS...]"
       
    17   echo
       
    18   echo "  Recursively find .thy/.ML files, adapting them to"
       
    19   echo "  the new CPure/Pure arrangement"
       
    20   echo
       
    21   echo "  Renames old versions of FILES by appending \"~~\"."
       
    22   echo
       
    23   exit 1
       
    24 }
       
    25 
       
    26 
       
    27 ## process command line
       
    28 
       
    29 [ "$#" -eq 0 -o "$1" = "-?" ] && usage
       
    30 
       
    31 SPECS="$@"; shift "$#"
       
    32 
       
    33 
       
    34 ## main
       
    35 
       
    36 #set by configure
       
    37 AUTO_PERL=/usr/bin/perl
       
    38 
       
    39 find $SPECS \( -name \*.thy -o -name \*.ML \) -print | \
       
    40   xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixcpure.pl"