Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 262cc10310733904f26782d043ebd46ef82e5440
Ticket: 1426692fffffffffffffffffffffffffffffffff
package provide/package ifneeded mismatch errors
User & Date: twylite on 2007-05-03 18:02:52
Changes

  1. icomment:
    Logged In: YES 
    user_id=91629
    Originator: NO
    
    Okay, I have come up with an alternative proposal that may cover both views (dgp & mine).
    
    Enhance the "package provide" to accept a version as a list of two elements.  The first element is the version that the package manager cares about, and the second is additional sub-version information (one could call it a patchlevel) that is stored by the package manager but not used in decision making.
    
    e.g. I want to version my packages at minor level for the purposes of management, but for diagnostics I want to be able to report the exact patchlevel or "build" of code that is running.
    
    In Tcl 8.4.x I could do this:
      package ifneeded p 1.1 { package provide p 1.1.7 }
    
    In Tcl 8.5a currently I must do this:
      package ifneeded p 1.1 { package provide p 1.1 ; set ::my_package_info(p) 1.1.7 }
    
      Note that I now need a custom work-around in 8.5 for something Tcl did for me in 8.4.
    
    Proposal:
      package ifneeded p 1.1 { package provide p {1.1 .7} }
    
      The "full" version of the package is [join $p_ver ""], i.e. 1.1.7
    
    This proposal is fully backwards compatible, and draws a clear line between version information that is seen by the package manager, and info that is not.
    
    Additionally:
    
    a) The "full" version would probably be returned by "package present p".
    
    b) I propose to extend "package present" to be usable without arguments, in which case it will return a list of name/full_version pairs (an alternative to looping over [package names] doing a [package present $name])
    
    c) I think this proposal can help to clarify/solve the ideal behaviour of -exact.  i.e. -exact will do an exact (effectively a string identity) match on the part of the version that the package manager takes decisions on (i.e. [lindex $pkg_ver 0]), and ignore sub-version information.
    
    
    
    
    
    
  2. login: "twylite"
  3. mimetype: "text/plain"
  4. username: "twylite"