Admin/PIDE/convert
author wenzelm
Thu, 06 Mar 2014 19:55:08 +0100
changeset 55960 beef468837b1
parent 53498 05313b45a5ae
permissions -rwxr-xr-x
proper position for decode_pos, which is relevant for completion;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53498
05313b45a5ae more portable hash-bang;
wenzelm
parents: 46245
diff changeset
     1
#!/usr/bin/env bash
46245
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     2
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     3
THIS="$(cd "$(dirname "$0")"; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     4
SUPER="$(cd "$THIS/.."; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     5
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     6
ISABELLE_REPOS="$(cd "$THIS/../.."; pwd)"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     7
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     8
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
     9
## main
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    10
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    11
FILEMAP="/tmp/filemap$$"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    12
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    13
echo "include COPYRIGHT" > "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    14
(
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    15
  cd "$ISABELLE_REPOS"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    16
  for FILE in $(find src/Pure -name "*.scala")
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    17
  do
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    18
    if grep "Module:.*PIDE" "$FILE" >/dev/null; then
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    19
      if [ "$("${HG:-hg}" status -u -n --color=never "$FILE")" = "" ]; then
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    20
        echo "include $FILE" >> "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    21
        echo "rename $FILE src/$(basename "$FILE")" >> "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    22
      fi
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    23
    fi
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    24
  done
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    25
)
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    26
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    27
cat "$FILEMAP"
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    28
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    29
"${HG:-hg}" convert --filemap "$FILEMAP" "$ISABELLE_REPOS" PIDE-repos
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    30
01496117a5cc basic support for PIDE Scala programming, independently of the main Isabelle repository;
wenzelm
parents:
diff changeset
    31
rm -f "$FILEMAP"