#11760: 'sage-location' shouldn't "initialize" .pc (pkg-config) files more than
once
-----------------------+----------------------------------------------------
   Reporter:  leif     |          Owner:                                        
         
       Type:  defect   |         Status:  needs_review                          
         
   Priority:  blocker  |      Milestone:  sage-4.7.2                            
         
  Component:  scripts  |       Keywords:  pkgconfig libpng Duplicate definition 
SAGE_ROOT
Work_issues:           |       Upstream:  N/A                                   
         
   Reviewer:           |         Author:  Leif Leonhardy                        
         
     Merged:           |   Dependencies:                                        
         
-----------------------+----------------------------------------------------

Comment(by leif):

 Replying to [comment:7 jhpalmieri]:
 > In lines 178-181:
 {{{
             if re.search("^SAGE_ROOT=", config, re.MULTILINE):
                 # There's already a definition of SAGE_ROOT,
                 # so skip this file. (Cf. #11760).
                 continue
 }}}
 > what if the path to SAGE_ROOT has changed?

 This is '''`initialize`'''`_pkgconfig_files()`, not `update_...()`.

 [[BR]]

 > Would it be better to delete this first line (containing
 `SAGE_ROOT=...`) and then proceed with the rest of the code in the loop?
 I guess that these files shouldn't have SAGE_ROOT in them already at this
 point, but just in case?

 As mentioned in the description, I was aiming at a ''quick'' fix which
 solves ''the issue we have'', not at curing arbitrary corrupted `pkg-
 config` files.

 Also, `initialize_pkgconfig_files()` is only called ''once'' (unless one
 messes around with Sage's files as noted for testing the patch).

 Nevertheless, any ''wrong'' definition of `SAGE_ROOT` present during
 `initialize_pkgconfig_files()` will be corrected in the subsequent call to
 `update_pkgconfig_files()`.

 [[BR]]

 Since `sage-location` won't have to deal with `.pc` files in the long term
 anyway, it doesn't make sense to implement sophisticated consistency
 checks and corrections ''there''.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11760#comment:8>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to