Just to add to what Chris mentions here - this fix should 
"Indiana-enable" Ruby.

 We're using symlinks that are created through the prototype file, and 
we're avoiding use of the postinstall script in Ruby entirely.

But on the other hand, IPS enablement brings up other bugs - both of 
which happen because different Ruby versions can coexist on the system 
at the same time. 

 I see that other SFWNV software is not immune to this either(eg., look 
at MySQL 5.x).

Here are the bugs we're introducing, to be Indiana-compliant.

-> The /usr/bin/ruby link will now point to the latest installed version 
of Ruby,  not the highest version of Ruby. (relevant since there are 
cases when the latest installed version could be different from the 
highest numbered version).
-> If someone has more than one version installed, and uninstalls the 
last version that she installed, then /usr/bin/ruby will be a dangling 
symlink. (same for the man page).

 What Ruby(and other SFWNV software that allows for multiple versions to 
co-exist) really needs is packaging features that recognize package 
versions, and manage links appropriately(this may exist, but I'm 
probably just unaware).  The postinstall script in the Ruby installation 
did just that.

 In any case, since having Ruby in Indiana(albeit with some bugs) is 
more effective than not.  This seems like an acceptable compromise.

 -ps


Chris Zhu wrote:
> Hi all,
>
> I updated  http://cr.opensolaris.org/~chriszhu/CR6635487-webrev/ for 
> all 3 bugs CR6641045,CR 6635487 and CR6632021.
>
> But here are other questions about put links into package prototype.
> 1) It's asked  in installing second version of ruby, if users want to 
> overwrite /usr/bin/ruby,  I wondered whether it will affect the system 
> installation (or jumpstar)or not,  and if system will choose the 
> default answer, it comes to the second question.
> 2) The /usr/bin/ruby will link to the last installed ruby , which 
> means the symlink of /usr/bin/ruby is not determined by latest version 
> but the installation sequence.
> 3) If multi-versions of ruby are installed in system, the link of 
> /usr/bin/ruby will not be removed or changed until all the ruby 
> packages are removed from the system, which will make /usr/bin/ruby 
> point to a file which does not exit, same for the ruby man page. It 
> means /usr/bin/ruby and the man page don't work if the linked package 
> is removed from the system, even other version of ruby is still in system.
>
> Following is the detail result of installing and removing SUNWruy18u 
> and SUNWruby19u in system.
>
> case 1) install SUNWruby18u first --> install SUNWruby19u -->   remove 
> SUNWruby18u first -->   then remove SUNWruby19u
> 1.1 install SUNWruby18u first
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby      ->  ./ruby18
> 1.2 then install SUNWruby19u
>  *--- it's asked in pkgadd , if  user wants to overwrite /usr/bin/ruby 
> , if yes*
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby19
> *--- it's asked in pkgadd , if  user wants to overwrite /usr/bin/ruby 
> , if no
> *    /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby18
> we supposed the answer is yes in following .
> 1.3 remove SUNWruby18u first
>         /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>         /usr/bin/ruby      ->  ./ruby19                       -------- 
> *right*
> 1.4 then remove SUNWruby19u
>      everything is removed
>
> secase 2)  in stall SUNWruby18u first --> then install SUNWruby19u,  
> --> remove SUNWruby19u first, --> then SUNWruby18u
> 2.1 install SUNWruby18u first
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby      ->  ./ruby18
> 2.2 then install SUNWruby19u
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby19
> 2.3 remove SUNWruby19u first
>         /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>         /usr/bin/ruby      ->  ./ruby19    *------ **because 
> /usr/bin/ruby is shared in different packages, it will not removed 
> until the last pkg is removed, so  **link is not accessible here, *
> 2.4 then remove SUNWruby18u
>      everything is removed
>
> case 3) in stall SUNWruby19u first then install SUNWruby18u,   remove 
> SUNWruby18u first, then SUNWruby19u
> 3.1 install SUNWruby19u first
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby19
> 3.2 then install SUNWruby18u
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby18                     ---------*not 
> linked to the latest version 1.9*
> 3.3 remove SUNWruby18u first
>         /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>         /usr/bin/ruby      ->  ./ruby18                  ---- 
> */usr/bin/ruby don't work anymore same for /usr/share/man/man1/ruby.1*
> 3.4 then remove SUNWruby19u
>      everything is removed       
>
> case 4)  in stall SUNWruby19u first then install SUNWruby18u,   remove 
> SUNWruby19u first,  then SUNWruby18u
> 4.1 install SUNWruby19u first
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby19
> 4.2 then install SUNWruby18u
>     /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>     /usr/bin/ruby19  ->  ../ruby/1.9/bin/ruby
>     /usr/bin/ruby      ->  ./ruby18                           
> ---------*not linked to the latest version 1.9*
> 4.3 remove SUNWruby19u first
>         /usr/bin/ruby18  ->  ../ruby/1.8/bin/ruby
>         /usr/bin/ruby      ->  ./ruby18                        
> -------- *right*
> 4.4 then remove SUNWruby18u
>      everything is removed       
>
>
> Regards
> Chris
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
>
>
> webstack-discuss mailing list
> webstack-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
>   


-- 
Prashant Srinivasan
F/OSS Enthusiast
Sun Microsystems, Inc.
http://blogs.sun.com/prashant
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x82FBDE5A


Reply via email to