#14166: use "cp -pR", not "cp -pr"
------------------------------------------+---------------------------------
       Reporter:  jhpalmieri              |         Owner:  leif        
           Type:  defect                  |        Status:  needs_review
       Priority:  blocker                 |     Milestone:  sage-5.8    
      Component:  scripts                 |    Resolution:              
       Keywords:  cp symlink OSX Solaris  |   Work issues:              
Report Upstream:  N/A                     |     Reviewers:              
        Authors:  John Palmieri           |     Merged in:              
   Dependencies:                          |      Stopgaps:              
------------------------------------------+---------------------------------
Changes (by jhpalmieri):

  * keywords:  cp symlink => cp symlink OSX Solaris


Old description:

> According to [http://www.gnu.org/savannah-
> checkouts/gnu/autoconf/manual/autoconf-2.68/html_node/Limitations-of-
> Usual-Tools.html#Limitations-of-Usual-Tools], we should avoid the "-r"
> flag for `cp`. On linux, using "-r" or "-R" doesn't make a difference,
> but on OS X, the man page for cp says that with the -r flag, "it does not
> correctly copy special files, symbolic links, or fifo's."
>
> As a result, after building from scratch using #6495 on OS X or
> !OpenSolaris, the various files `doc/en/reference/MODULE/conf.py`, which
> are all supposed to by symlinks to `doc/en/reference/conf_sub.py`, are
> copies of that file instead, and the hg repo is not clean. So I'm marking
> this as a blocker. I think that to fix the real problem, only the Sage
> library needs to be patched, but we might as well apply the scripts patch
> as well. I think that the only other instance of "cp -pr" in any spkg is
> in the R spkg, and I don't think those instances are worth fixing right
> now.

New description:

 According to [http://www.gnu.org/savannah-
 checkouts/gnu/autoconf/manual/autoconf-2.68/html_node/Limitations-of-
 Usual-Tools.html#Limitations-of-Usual-Tools], we should avoid the "-r"
 flag for `cp`. On linux, using "-r" or "-R" doesn't make a difference, but
 on OS X, the man page for cp says that with the -r flag, "it does not
 correctly copy special files, symbolic links, or fifo's."

 As a result, after building from scratch using #6495 on OS X or
 !OpenSolaris, the various files `doc/en/reference/MODULE/conf.py`, which
 are all supposed to by symlinks to `doc/en/reference/conf_sub.py`, are
 copies of that file instead, and the hg repo is not clean. So I'm marking
 this as a blocker. I think that to fix the real problem, only the Sage
 library needs to be patched, but we might as well apply the scripts patch
 as well. I think that the only other instance of "cp -pr" in any spkg is
 in the R spkg, and I don't think those instances are worth fixing right
 now.

 -----

 Apply [attachment:trac_14166-sage.patch].

--

Comment:

 On Solaris, things are more complicated. If we use `cp -pr`, then it
 behaves like OS X, i.e., badly. If we use `cp -pR`, then it still doesn't
 work; instead, `cp -pPR` almost works. The only problem is that file
 permissions can get messed up, at least when a file in one directory is a
 link pointing to another directory. Consider this directory TEST:
 {{{
 $ ls -l TEST/
 total 6
 drwxr-xr-x   2 palmieri other          3 Feb 25 04:07 dir/
 -rw-r--r--   1 palmieri other         79 Feb 24 21:13 FILE
 lrwxrwxrwx   1 palmieri other          4 Feb 25 04:06 link1 -> FILE
 $ ls -l TEST/dir/
 total 1
 lrwxrwxrwx   1 palmieri other          4 Feb 25 04:07 link2 -> FILE
 }}}
 Now copy it:
 {{{
 $ cp -pPR TEST X
 $ ls -l X
 total 6
 drwxr-xr-x   2 palmieri other          3 Feb 25 04:07 dir/
 -rwxrwxrwx   1 palmieri other         79 Feb 25 04:06 FILE*
 lrwxrwxrwx   1 palmieri other          4 Feb 25 04:08 link1 -> FILE*
 $ ls -l X/dir
 total 1
 lrwxrwxrwx   1 palmieri other          4 Feb 25 04:08 link2 -> FILE
 }}}
 Note the permissions on FILE. The way around this seems to be to use
 `/usr/xpg4/bin/cp -pPR@ SOURCE TARGET`, naturally.

 Let's ignore the scripts patch and just focus on the patch for the Sage
 library.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14166#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to