From: ser@... (Sean Russell) Date: 2003-04-09T01:55:09+09:00 Subject: Re: Call for standardized package installation procedure ahoward wrote in message news:... > On Tue, 8 Apr 2003 james_b@neurogami.com wrote: .... > i posted some code a while back which i have been using personally for that > purpose. the package i posted is called 'library', which as someone pointed .... > this is a *very* bad idea. ruby should support ***versioning***. Amen, but this isn't a new request. Interestingly, I couldn't find an RCR; I would have *sworn* there was one. > just like libtool versioning. if this were supported, you could have a script > using I'd like something better than libtool. libtool isn't very flexible. Something like Portage's versioning mechanism, perhaps using Ruby ranges: # In all examples, the require mechanism attempts to use the most recent (latest) version # that satisfies the requirements. # Require exactly version 1.0.1 of package1 require 'package1', "=1.0.1" #1 # Require a version of package2 that is greater than 1.0, but less than or equal to 2.1.1 require 'package2', '>1.0, <=2.1.1' #2 # Require a version of package3 less than version 2.0 require 'package3', '<2.0' #3 # Require at least version 1.0 require 'package4', '>=1.0' #4 # Use the latest version of package5 installed require 'package5' This syntax is easier than doing something like: require 'package2', ( Version.new("1.0") .. Version.new( "2.1.1") ) but it could be implemented the second way. The way that packages are installed would have to change; probably: ${ruby.site.lib}// > and pick up the latest package supporting the interface you require. eg. when > 2.2.0 comes along the require picks up that one. the Library::install and > Library::unintall methods i have require packages live in a > 'package-interface.revsion.age' named directory for this to work and a bunch > of other hacks i haven't had time to automate or inflict on anyone yet, but > they do allow one to have mutiple versioned installs of a package on site. > eg: > > cgi-0.1.0.rb > cgi-2.1.2.rb > cgi-3.1.0.rb Although, I'd limit this to specifying the version on the package, rather than the files. This is a great hack you've got, but it *must* be part of native Ruby to be really useful. Most versioning problems come when you're using somebody else's software, with its own set of versioning requirements. > IMHO versioning is one of the biggest missing peices from the entire ruby > install process. am i the only who feels this is very important? Not at all. But, as I said, I think this is one thing that isn't going to be improved by community effort. Matz is going to have to extend 'require' to support this before the majority of the benefits will be seen. IMHO. --- SER