more uniform / portable representation of the idea of "copy_dir" (NB: cp -f dereferences symlinks on GNU/Linux, but does not on old-school Unixen including BSD/Mac OS X);
authorwenzelm
Thu, 16 Feb 2012 14:14:58 +0100
changeset 46502 3d43d4d4d071
parent 46501 fe51817749d1
child 46503 186f4cab2ba0
more uniform / portable representation of the idea of "copy_dir" (NB: cp -f dereferences symlinks on GNU/Linux, but does not on old-school Unixen including BSD/Mac OS X);
src/Pure/System/isabelle_system.ML
src/Tools/jEdit/lib/Tools/jedit
--- a/src/Pure/System/isabelle_system.ML	Thu Feb 16 09:51:34 2012 +0100
+++ b/src/Pure/System/isabelle_system.ML	Thu Feb 16 14:14:58 2012 +0100
@@ -62,7 +62,7 @@
 
 fun copy_dir src dst =
   if File.eq (src, dst) then ()
-  else (system_command ("cp -r -f " ^ File.shell_path src ^ "/. " ^ File.shell_path dst); ());
+  else (system_command ("cp -p -R -f " ^ File.shell_path src ^ "/. " ^ File.shell_path dst); ());
 
 
 (* unique tmp files *)
--- a/src/Tools/jEdit/lib/Tools/jedit	Thu Feb 16 09:51:34 2012 +0100
+++ b/src/Tools/jEdit/lib/Tools/jedit	Thu Feb 16 14:14:58 2012 +0100
@@ -223,11 +223,11 @@
   rm -rf dist || failed
   mkdir -p dist dist/classes || failed
 
-  cp -pR "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/.
-  cp -pR "${RESOURCES[@]}" dist/classes/.
+  cp -p -R -f "$ISABELLE_JEDIT_BUILD_HOME/contrib/$ISABELLE_JEDIT_BUILD_VERSION/." dist/.
+  cp -p -R -f "${RESOURCES[@]}" dist/classes/.
   cp src/jEdit.props dist/properties/.
-  cp -pR src/modes/. dist/modes/.
-  cp -pR "$SCALA_HOME/misc/scala-tool-support/jedit/modes/scala.xml" dist/modes/.
+  cp -p -R -f src/modes/. dist/modes/.
+  cp -p -R -f "$SCALA_HOME/misc/scala-tool-support/jedit/modes/scala.xml" dist/modes/.
 
   perl -i -e 'while (<>) {
     if (m/NAME="javacc"/) {
@@ -237,7 +237,7 @@
       print qq,<MODE NAME="scala" FILE="scala.xml" FILE_NAME_GLOB="*.scala" />\n\n,; }
     print; }' dist/modes/catalog
 
-  cp -pR "${JEDIT_JARS[@]}" "$SCALA_HOME/lib/scala-compiler.jar" dist/jars/. || failed
+  cp -p -R -f "${JEDIT_JARS[@]}" "$SCALA_HOME/lib/scala-compiler.jar" dist/jars/. || failed
   (
     for JAR in "$JEDIT_JAR" "${JEDIT_JARS[@]}" "$PURE_JAR" "$SCALA_HOME/lib/scala-compiler.jar"
     do