more portable tar_options;
authorwenzelm
Sun, 21 Oct 2018 19:39:46 +0200
changeset 69170 6d28536481ad
parent 69169 a5640ec8fcb8
child 69171 710845a85944
more portable tar_options;
src/Pure/Admin/build_release.scala
--- a/src/Pure/Admin/build_release.scala	Sun Oct 21 19:34:11 2018 +0200
+++ b/src/Pure/Admin/build_release.scala	Sun Oct 21 19:39:46 2018 +0200
@@ -145,6 +145,10 @@
   private def execute_tar(dir: Path, args: String): Unit =
     Isabelle_System.gnutar(args, cwd = dir.file).check
 
+  private def tar_options: String =
+    if (Platform.is_macos) "--owner=root --group=staff" else "--owner=root --group=root"
+
+
   private val default_platform_families = List("linux", "windows", "macos")
 
   def build_release(base_dir: Path,
@@ -275,7 +279,7 @@
 find "$DIST_NAME" -type f "(" -name "*.thy" -o -name "*.ML" -o -name "*.scala" ")" -print | xargs chmod -f u-w
 """)
 
-          execute_tar(release.dist_dir, "--owner=root --group=root -czf " +
+          execute_tar(release.dist_dir, tar_options + " -czf " +
             File.bash_path(release.isabelle_archive) + " " + Bash.string(release.dist_name))
 
           release.execute_dist_name(release.dist_dir, """
@@ -384,8 +388,8 @@
 
             execute(tmp_dir, "chmod -R a+r " + Bash.string(name))
             execute(tmp_dir, "chmod -R g=o " + Bash.string(name))
-            execute_tar(tmp_dir, "--owner=root --group=root -czf " +
-              File.bash_path(release.isabelle_library_archive) +
+            execute_tar(tmp_dir,
+              tar_options + " -czf " + File.bash_path(release.isabelle_library_archive) +
               " " + Bash.string(name + "/browser_info"))
           })
       }