On Sat, Nov 7, 2009 at 6:48 AM, Dr. David Kirkby <david.kir...@onetel.net> wrote: > "cp -L$OPT devel/sage-main "$TMP"/devel/sage-main"
Maybe this is done to handle the case where "sage-main" is a symlink to an actual directory. The option -L means to copy symlinks as real files. Otherwise, the symlink may be copied (when using -a, at least --- unspecified by posix when using -Rp). As a matter of fact, using "cp -Lra" does NOT work as claimed above, because the -a option implies -P which overrides the -L option. Using "cp -raL" would copy symlinks, though. The actual meaning of "-a" in gnu cp is really "-dRp", not just "-Rp". The "-d" option should be replaced with "-P" posix option (preserve symlinks), except the "-d" also preserves hard links. I don't think posix has an option to preserve hard links. For the line with -L, if the only motivation is to follow the symlink in case sage-main itself is a symlink, the correct option is -H rather than -L, but it may be possible to use (instead of -H or -L): cp -$OPT devel/sage-main/ "$TMP"/devel/sage-main" the extra "/" at the end of the source operand makes it to expand the symlink, if any. Maybe somebody (wstein?) can comment on why the -L was added to the script? ---- WRT -d option (preserve symlinks + hardlinks). It's clearly necessary to preserve symbolic links. For instance, dynamic libraries use symlinks. Is it really necessary for sage-bdist to preserve hardlinks? [ ... checking a bdist tarball of 4.1.1 ... ] there is exactly one hardlink in this bdist tarball: "local/bin/python" is a hardlink to "local/bin/python2.6". IOW, using -P instead of -d would produce a tarball with two copies of the python binary. Shouldn't this be handled with a symbolic link instead? ------------------------------------- My suggestion would be: a. fix installation of python so that a symlink is used instead of a hard link b. use -PRp as options for cp (this is posix!) c. for the sage-main directory, use the trailing / trick so the -L / -H option is not necessary (double check this with whoever wrote the sage-bdist script to use -L option) d. for systems where -P is not supported, figure out a way to copy preserving symlinks. [a. is not critical, but as long as it's not done, sage-bdist should keep using -a or -d on gnu systems, to avoid bloat in the bdist tarfile] Gonzalo PS: I've attached a shell script which exhibits the different behaviours of cp with different options. You can try something like that in HP-UX to see if there is a way to preserve symbolic links in a copy. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
cp-test.sh
Description: Bourne shell script