suppress Mercurial backup files;
authorwenzelm
Sat, 26 Mar 2011 16:21:41 +0100
changeset 42124 7519c7c33017
parent 42123 c407078c0d47
child 42125 a8cbb9371154
suppress Mercurial backup files; uniform treatment of tool filtering in bash/perl/scala;
bin/isabelle
lib/scripts/tools.pl
src/Pure/System/isabelle_system.scala
--- a/bin/isabelle	Sat Mar 26 16:10:22 2011 +0100
+++ b/bin/isabelle	Sat Mar 26 16:21:41 2011 +0100
@@ -55,7 +55,7 @@
 do
   TOOL="$DIR/$TOOLNAME"
   case "$TOOL" in
-    *~) ;;
+    *~ | *.orig) ;;
     *) [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" ;;
   esac
 done
--- a/lib/scripts/tools.pl	Sat Mar 26 16:10:22 2011 +0100
+++ b/lib/scripts/tools.pl	Sat Mar 26 16:21:41 2011 +0100
@@ -14,7 +14,7 @@
     if (opendir DIR, $dir) {
       for my $name (readdir DIR) {
         my $file = "$dir/$name";
-        if (-f $file and -x $file and !($file =~ /~$/)) {
+        if (-f $file and -x $file and !($file =~ /~$/ or $file =~ /\.orig$/)) {
           if (open FILE, $file) {
             my $description;
             while (<FILE>) {
--- a/src/Pure/System/isabelle_system.scala	Sat Mar 26 16:10:22 2011 +0100
+++ b/src/Pure/System/isabelle_system.scala	Sat Mar 26 16:21:41 2011 +0100
@@ -290,7 +290,10 @@
   {
     getenv_strict("ISABELLE_TOOLS").split(":").find { dir =>
       val file = platform_file(dir + "/" + name)
-      try { file.isFile && file.canRead && file.canExecute }
+      try {
+        file.isFile && file.canRead && file.canExecute &&
+          !name.endsWith("~") && !name.endsWith(".orig")
+      }
       catch { case _: SecurityException => false }
     } match {
       case Some(dir) =>