# HG changeset patch # User wenzelm # Date 1549292504 -3600 # Node ID 2c3e5e58d93f102e3e717d51a20628f5a20f15cf # Parent c175499a7537581e4549fc72c57c9dc18bf76518 more thorough File.set_executable, notably for Windows; diff -r c175499a7537 -r 2c3e5e58d93f src/Pure/Admin/build_cygwin.scala --- a/src/Pure/Admin/build_cygwin.scala Mon Feb 04 15:45:40 2019 +0100 +++ b/src/Pure/Admin/build_cygwin.scala Mon Feb 04 16:01:44 2019 +0100 @@ -35,7 +35,7 @@ File.write(cygwin_isabelle + Path.explode("cygwin_mirror"), mirror) - File.executable(cygwin_exe) + File.set_executable(cygwin_exe, true) Isabelle_System.bash(File.bash_path(cygwin_exe) + " -h /dev/null").check val res = diff -r c175499a7537 -r 2c3e5e58d93f src/Pure/Admin/build_release.scala --- a/src/Pure/Admin/build_release.scala Mon Feb 04 15:45:40 2019 +0100 +++ b/src/Pure/Admin/build_release.scala Mon Feb 04 16:01:44 2019 +0100 @@ -467,7 +467,7 @@ .replaceAllLiterally("{CLASSPATH}", classpath.map("$ISABELLE_HOME/" + _).mkString(":")) .replaceAllLiterally("/jdk/", "/" + jdk_component + "/")) - File.executable(isabelle_run) + File.set_executable(isabelle_run, true) val linux_app = isabelle_target + Path.explode("contrib/linux_app") File.move(linux_app + Path.explode("Isabelle"), @@ -595,7 +595,7 @@ File.write(isabelle_target + cygwin_bat, File.read(cygwin_template + cygwin_bat) .replaceAllLiterally("{MIRROR}", cygwin_mirror)) - File.executable(isabelle_target + cygwin_bat) + File.set_executable(isabelle_target + cygwin_bat, true) for (name <- List("isabelle/postinstall", "isabelle/rebaseall")) { val path = Path.explode(name) @@ -635,7 +635,7 @@ Bytes.write(release.dist_dir + isabelle_exe, Bytes.read(sfx_exe) + Bytes(sfx_txt) + Bytes.read(exe_archive)) - File.executable(release.dist_dir + isabelle_exe) + File.set_executable(release.dist_dir + isabelle_exe, true) } }) progress.echo("DONE") diff -r c175499a7537 -r 2c3e5e58d93f src/Pure/General/file.scala --- a/src/Pure/General/file.scala Mon Feb 04 15:45:40 2019 +0100 +++ b/src/Pure/General/file.scala Mon Feb 04 16:01:44 2019 +0100 @@ -349,9 +349,10 @@ else path.file.canExecute } - def executable(path: Path) + def set_executable(path: Path, flag: Boolean) { - if (Platform.is_windows) Isabelle_System.bash("chmod a+x " + bash_path(path)).check - else path.file.setExecutable(true, false) + if (Platform.is_windows && flag) Isabelle_System.bash("chmod a+x " + bash_path(path)).check + else if (Platform.is_windows) Isabelle_System.bash("chmod a-x " + bash_path(path)).check + else path.file.setExecutable(flag, false) } } diff -r c175499a7537 -r 2c3e5e58d93f src/Pure/Thy/export.scala --- a/src/Pure/Thy/export.scala Mon Feb 04 15:45:40 2019 +0100 +++ b/src/Pure/Thy/export.scala Mon Feb 04 16:01:44 2019 +0100 @@ -301,7 +301,7 @@ progress.echo(export_prefix + "export " + path) Isabelle_System.mkdirs(path.dir) Bytes.write(path, entry.uncompressed(cache = store.xz_cache)) - if (entry.executable) File.executable(path) + File.set_executable(path, entry.executable) } } }