Hi

I thought there might be more people out there with a problem of choosing
a wrong install class in the beginning, and finding out they cannot change
it easily later. 

Actually, "upgrade" to a new "install class" should do a trick, but our
current upgrade procedure does not. :-( 
(It will in the future, though ;->)

EXAMPLE: after "custom/normal" install, you will have no compiler, make &
co installed on your system.
 
In order to be able to compile things, You will need several packages
which do not get installed in "normal" install. The easiest way to
get them is to use the same method as DrakX uses during the install:

On your install CD, in Mandrake/base dir, there is a file called
compssList. In this file, there is a list of all the packages on this CD,
and three lists of numbers corresponding to importance of these packages
on "normal" (desktop workstation), "server" and "developer" instalation.

Since upgrade does not work properly at the moment, I have written a
stupid little perl program, which tries to install the tools you need.
It is just a quick hack, and it may or may not work the way you expect -
but I think it will not do any damage to your existing system.
(The prog. is attached to this e-mail.)

run-time options are:

--class=(devel|server|normal) 
--(no)interactive 
--(no)test
--list=<FILE>

--level=<NUMBER> (0..100)

"NUMBER" defaults to 50. Lower number == more programs will be installed. 

Default values are:

/tmp/change_install_class.pl\
        --class=normal level=50 --interactive --test \
        --list=/mnt/cdrom/Mandrake/base/compssList

Try it out in "test" mode, experiment with "level" until you are happy,
then go for "notest". 

good luck!

        Denis
-- 
-----------------------------------------------------
Dr. Denis Havlik                <http://www.ap.univie.ac.at/users/havlik>
Mandrakesoft            |||     e-mail: [EMAIL PROTECTED]
Quality Assurance      (@ @)    (private: [EMAIL PROTECTED])    
-------------------oOO--(_)--OOo---------------------
#!/usr/bin/perl

# Denis Havlik <[EMAIL PROTECTED]>

# change_install_class.pl: a very simple prog for changing the install-class 
# of a mandrake 7.x system by adding packages which have 
# ("importance" > $level) in install class "class"

# v. 0.1 - Thu Apr 27 2000 - initial release

# WARNING: urpmi MUST be installed and initialised in order for this prog. 
# to work. Normally, urpmi should be, installed on every Mandrake 7.x system.  
# See "man urpmi.addmedia" if it is not!

use Getopt::Long;

GetOptions( "class=s" => \$class,
            "level=i" => \$level,
            "list=s" => \$list,
            "interactive!" => \$interactive,
            "test!" => \$test
            );
$class = "normal" unless defined $class;
$list  = "/mnt/cdrom/Mandrake/base/compssList" unless defined $list;
$level = 50 unless defined $level;
$interactive = 1 unless defined $interactive;
$test = 1 unless defined $test;

print "\n PROGRAM WILL BE RUN AS: $0\\\n";
print "\t--class=$class level=$level ";
if ($interactive) {
  print "--interactive ";
} else {
  print "--nointeractive ";
}
if ($test) {
  print "--test ";
} else {
  print "--notest ";
}
print "\\\n\t--list=$list\n\n";

open LIST , "<$list" or die "cannot open $list for reading\n";
while (<LIST>) {
  if (/[a-z]$/) { 
    @class = map {s/$class/$1/} split; 
  } else {
    ($package, @weight) = split;
    for $i (0..$#weight) {
      $weight = $weight || ($weight[$i] * $class[$i]);
    }  
    if ($weight >= $level ) {
      printf "install %20s (weight=%3d)", $package,$weight;
      if ($test) {
        print "\t(TEST MODE!)\n";
      } else {
        if ($interactive) {
          print " (y/N)?\t"; 
          $answer = <STDIN>;
          if ( $answer =~ /^y/i ) {
            system ("urpmi $package"); 
          } else {
            print "skipping...\n"
          }
          $answer = undef;
        } else {
          system ("urpmi --auto $package");
        }
      }
    } else {
      printf "skip   %20s (weight=%3d)\n", $package,$weight;
    }
    $weight = undef;
  }
}

Reply via email to