/[fai]/trunk/scripts/install_packages
ViewVC logotype

Diff of /trunk/scripts/install_packages

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 614 by lange, Wed May 9 10:22:28 2001 UTC revision 753 by lange, Fri Aug 31 13:23:40 2001 UTC
# Line 29  Line 29 
29    
30  # main part  # main part
31  $| = 1;  $| = 1;
32  @aptcommands = qw/install remove dselect-upgrade/;  # order of commands to execute
33  %options = (  @commands = qw/taskinst install remove dselect-upgrade/;
34                         install => '-y --fix-missing',  %command = (
35                         remove  => '-y --purge',              install => 'apt-get -y --fix-missing install',
36               "dselect-upgrade" => '-y',              remove  => 'apt-get -y --purge remove',
37      "dselect-upgrade" => 'apt-get -y dselect-upgrade',
38             "taskinst" => 'tasksel -n install',
39  );  );
40    
41  # currently no test, always execute  # currently no test, always execute
# Line 41  $test = 0; Line 43  $test = 0;
43    
44  $verbose=$ENV{verbose};  $verbose=$ENV{verbose};
45  $FAI_ROOT = $ENV{FAI_ROOT};  $FAI_ROOT = $ENV{FAI_ROOT};
 $rootcmd = ($FAI_ROOT eq "/" ) ? '' : "chroot $FAI_ROOT";  
   
46  $classpath = "/fai/package_config";  $classpath = "/fai/package_config";
47    $rootcmd = ($FAI_ROOT eq "/" ) ? '' : "chroot $FAI_ROOT";
48  @classes = grep { !/^#|^\s*$/} split(/[\s\n]+/,$ENV{classes});  @classes = grep { !/^#|^\s*$/} split(/[\s\n]+/,$ENV{classes});
49    
50  # read all package config files  # read all package config files
# Line 59  foreach $entry (@preloadlist,@preloadrml Line 59  foreach $entry (@preloadlist,@preloadrml
59    execute("wget -nv -P$FAI_ROOT/$directory $url");    execute("wget -nv -P$FAI_ROOT/$directory $url");
60  }  }
61    
62  # call apt-get for each command and the list of packages  # call apt-get or tasksel for each type of command whith the list of packages
63  foreach $type (@aptcommands) {  foreach $type (@commands) {
64    if ($type eq "dselect-upgrade") {    if ($type eq "dselect-upgrade") {
65      dselectupgrade();      dselectupgrade();
66      next;      next;
67    }    }
68    
69    my $packlist = join(' ',@{$list{$type}});    my $packlist = join(' ',@{$list{$type}});
   
70    if ($packlist) {    if ($packlist) {
71      execute("$rootcmd apt-get $options{$type} $type $packlist");      execute("$rootcmd $command{$type} $packlist");
72    }    }
73  }  }
74    
# Line 137  sub dselectupgrade { Line 136  sub dselectupgrade {
136    close TMP;    close TMP;
137    
138    execute("$rootcmd dpkg --set-selections < $tempfile");    execute("$rootcmd dpkg --set-selections < $tempfile");
139    execute("$rootcmd apt-get $options{$type} dselect-upgrade");    execute("$rootcmd $command{$type}");
140    unlink $tempfile;    unlink $tempfile;
141  }  }

Legend:
Removed from v.614  
changed lines
  Added in v.753

  ViewVC Help
Powered by ViewVC 1.1.5