Mageia Bugzilla – Attachment 9138 Details for
Bug 20551
Installer no longer respects default rpmsrate level when selecting packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
old install2 test case
test-old.pl (text/plain), 5.95 KB, created by
Thierry Vignaud
on 2017-03-23 15:52:54 CET
(
hide
)
Description:
old install2 test case
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2017-03-23 15:52:54 CET
Size:
5.95 KB
patch
obsolete
> >use lib qw(/usr/lib/libDrakX ./install/); >#use diagnostics; >use strict; >use vars qw($o); >use Getopt::Long qw(GetOptionsFromArray :config no_ignore_case no_auto_abbrev no_getopt_compat pass_through); >use Data::Dumper; ># make results reproducible: >$Data::Dumper::Sortkeys = 1; > > >BEGIN { $::isInstall = 1 } > >#-###################################################################################### >#- misc imports >#-###################################################################################### >use install::steps_list; >use common; > >#-####################################################################################### >=head1 Data Structure > >=head2 $O; > >$o (or $::o in other modules) is the big struct which contain, well everything: > >=over 4 > >=item * globals > >=item * the interactive methods > >=item * ... > >=back > >if you want to do a kickstart file, you just have to add all the required fields (see for example >the variable $default) > >=cut >#-####################################################################################### >$o = $::o = { ># bootloader => { linear => 0, message => 1, timeout => 5, restricted => 0 }, >#- packages => [ qw() ], > partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0 }, #-, readonly => 0 }, > authentication => { sha512 => 1, shadow => 1 }, > locale => { lang => 'en_US' }, >#- isUpgrade => 0, > toRemove => [], > toSave => [], >#- simple_themes => 1, > > timezone => { >#- timezone => "Europe/Paris", >#- UTC => 1, > }, >#- superuser => { password => 'a', shell => '/bin/bash', realname => 'God' }, >#- user => { name => 'foo', password => 'bar', home => '/home/foo', shell => '/bin/bash', realname => 'really, it is foo' }, > >#- keyboard => 'de', >#- display => "192.168.1.19:1", > steps => \%install::steps_list::installSteps, > orderedSteps => \@install::steps_list::orderedInstallSteps, > > #- for the list of fields available, see network/network.pm > net => { > #- network => { HOSTNAME => 'abcd' }, > #- resolv => { DOMAINNAME => 'foo.xyz' }, > #- ifcfg => { > #- eth0 => { DEVICE => "eth0", IPADDR => '1.2.3.4', NETMASK => '255.255.255.128' } > #- }, > }, > untranslated_license => "Bla license" >#-step : the current one >#-prefix >#-mouse >#-keyboard >#-netc >#-methods >#-packages compss > >}; > >=over > >=item parse_args($cfg, $patch) > >Parse arguments (which came from either the boot loader command line or its configuration file). > >=cut > >sub parse_args { > my ($cfg, $patch); > my %cmdline = map { > my ($n, $v) = split /=/; > $n => defined($v) ? $v : 1; > } split ' ', cat_("/proc/cmdline"); > > my $opt; foreach (@_) { > if (/^--?(.*)/) { > $cmdline{$opt} = 1 if $opt; > $opt = $1; > } else { > $cmdline{$opt} = $_ if $opt; > $opt = ''; > } > } $cmdline{$opt} = 1 if $opt; > > #- from stage1 > put_in_hash(\%ENV, { getVarsFromSh('/tmp/env') }); > exists $ENV{$_} and $cmdline{lc($_)} = $ENV{$_} foreach qw(METHOD PCMCIA KICKSTART); > > map_each { > my ($n, $v) = @_; > my $f = ${{ > keyboard => sub { $o->{keyboard} = $v; push @::auto_steps, 'selectKeyboard' }, > lang => sub { $o->{lang} = $v }, > flang => sub { $o->{lang} = $v; push @::auto_steps, 'selectLanguage' }, > langs => sub { $o->{locale}{langs} = +{ map { $_ => 1 } split(':', $v) } }, > method => sub { $o->{method} = $v }, > pcmcia => sub { $o->{pcmcia} = $v }, > step => sub { $o->{steps}{first} = $v }, > meta_class => sub { $o->{meta_class} = $v }, > freedriver => sub { $o->{freedriver} = $v }, > > # fs/block options: > no_bad_drives => sub { $o->{partitioning}{no_bad_drives} = 1 }, > nodmraid => sub { $o->{partitioning}{nodmraid} = 1 }, > readonly => sub { $o->{partitioning}{readonly} = $v ne "0" }, > use_uuid => sub { $::no_uuid_by_default = !$v }, > > # urpmi options: > debug_urpmi => sub { $o->{debug_urpmi} = 1 }, > deploops => sub { $o->{deploops} = 1 }, > justdb => sub { $o->{justdb} = 1 }, > 'tune-rpm' => sub { $o->{'tune-rpm'} = 'all' }, > > # GUI options: > vga16 => sub { $o->{vga16} = $v }, > vga => sub { $o->{vga} = $v =~ /0x/ ? hex($v) : $v }, > display => sub { $o->{display} = $v }, > askdisplay => sub { print "Please enter the X11 display to perform the install on ? "; $o->{display} = chomp_(scalar(<STDIN>)) }, > text => sub { $o->{interactive} = "curses" }, > stdio => sub { $o->{interactive} = "stdio" }, > newt => sub { $o->{interactive} = "curses" }, > simple_themes => sub { $o->{simple_themes} = 1 }, > theme => sub { $o->{theme} = $v }, > doc => sub { $o->{doc} = 1 }, #- will be used to know that we're running for the doc team, > #- e.g. we want screenshots with a good B&W contrast > > security => sub { $o->{security} = $v }, > > # auto install options: > noauto => sub { $::noauto = 1 }, > testing => sub { $::testing = 1 }, > patch => sub { $patch = 1 }, > defcfg => sub { $cfg = $v }, > kickstart => sub { $::auto_install = $v }, > > local_install => sub { $::local_install = 1 }, > uml_install => sub { $::uml_install = $::local_install = 1 }, > auto_install => sub { $::auto_install = $v }, > > # debugging options: > useless_thing_accepted => sub { $o->{useless_thing_accepted} = 1 }, > alawindows => sub { $o->{security} = 0; $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 }, > fdisk => sub { $o->{partitioning}{fdisk} = 1 }, > nomouseprobe => sub { $o->{nomouseprobe} = $v }, > updatemodules => sub { $o->{updatemodules} = 1 }, > > suppl => sub { $o->{supplmedia} = $v }, > askmedia => sub { $o->{askmedia} = 1 }, > restore => sub { $::isRestore = 1 }, > compsslistlevel => sub { $o->{compssListLevel} = $v }, > }}{lc $n}; &$f if $f; > } %cmdline; > > ($cfg, $patch); >} > >my ($cfg, $patch) = parse_args(@ARGV); >output("o_old.pm", Dumper($o)); > >=back
use lib qw(/usr/lib/libDrakX ./install/); #use diagnostics; use strict; use vars qw($o); use Getopt::Long qw(GetOptionsFromArray :config no_ignore_case no_auto_abbrev no_getopt_compat pass_through); use Data::Dumper; # make results reproducible: $Data::Dumper::Sortkeys = 1; BEGIN { $::isInstall = 1 } #-###################################################################################### #- misc imports #-###################################################################################### use install::steps_list; use common; #-####################################################################################### =head1 Data Structure =head2 $O; $o (or $::o in other modules) is the big struct which contain, well everything: =over 4 =item * globals =item * the interactive methods =item * ... =back if you want to do a kickstart file, you just have to add all the required fields (see for example the variable $default) =cut #-####################################################################################### $o = $::o = { # bootloader => { linear => 0, message => 1, timeout => 5, restricted => 0 }, #- packages => [ qw() ], partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0 }, #-, readonly => 0 }, authentication => { sha512 => 1, shadow => 1 }, locale => { lang => 'en_US' }, #- isUpgrade => 0, toRemove => [], toSave => [], #- simple_themes => 1, timezone => { #- timezone => "Europe/Paris", #- UTC => 1, }, #- superuser => { password => 'a', shell => '/bin/bash', realname => 'God' }, #- user => { name => 'foo', password => 'bar', home => '/home/foo', shell => '/bin/bash', realname => 'really, it is foo' }, #- keyboard => 'de', #- display => "192.168.1.19:1", steps => \%install::steps_list::installSteps, orderedSteps => \@install::steps_list::orderedInstallSteps, #- for the list of fields available, see network/network.pm net => { #- network => { HOSTNAME => 'abcd' }, #- resolv => { DOMAINNAME => 'foo.xyz' }, #- ifcfg => { #- eth0 => { DEVICE => "eth0", IPADDR => '1.2.3.4', NETMASK => '255.255.255.128' } #- }, }, untranslated_license => "Bla license" #-step : the current one #-prefix #-mouse #-keyboard #-netc #-methods #-packages compss }; =over =item parse_args($cfg, $patch) Parse arguments (which came from either the boot loader command line or its configuration file). =cut sub parse_args { my ($cfg, $patch); my %cmdline = map { my ($n, $v) = split /=/; $n => defined($v) ? $v : 1; } split ' ', cat_("/proc/cmdline"); my $opt; foreach (@_) { if (/^--?(.*)/) { $cmdline{$opt} = 1 if $opt; $opt = $1; } else { $cmdline{$opt} = $_ if $opt; $opt = ''; } } $cmdline{$opt} = 1 if $opt; #- from stage1 put_in_hash(\%ENV, { getVarsFromSh('/tmp/env') }); exists $ENV{$_} and $cmdline{lc($_)} = $ENV{$_} foreach qw(METHOD PCMCIA KICKSTART); map_each { my ($n, $v) = @_; my $f = ${{ keyboard => sub { $o->{keyboard} = $v; push @::auto_steps, 'selectKeyboard' }, lang => sub { $o->{lang} = $v }, flang => sub { $o->{lang} = $v; push @::auto_steps, 'selectLanguage' }, langs => sub { $o->{locale}{langs} = +{ map { $_ => 1 } split(':', $v) } }, method => sub { $o->{method} = $v }, pcmcia => sub { $o->{pcmcia} = $v }, step => sub { $o->{steps}{first} = $v }, meta_class => sub { $o->{meta_class} = $v }, freedriver => sub { $o->{freedriver} = $v }, # fs/block options: no_bad_drives => sub { $o->{partitioning}{no_bad_drives} = 1 }, nodmraid => sub { $o->{partitioning}{nodmraid} = 1 }, readonly => sub { $o->{partitioning}{readonly} = $v ne "0" }, use_uuid => sub { $::no_uuid_by_default = !$v }, # urpmi options: debug_urpmi => sub { $o->{debug_urpmi} = 1 }, deploops => sub { $o->{deploops} = 1 }, justdb => sub { $o->{justdb} = 1 }, 'tune-rpm' => sub { $o->{'tune-rpm'} = 'all' }, # GUI options: vga16 => sub { $o->{vga16} = $v }, vga => sub { $o->{vga} = $v =~ /0x/ ? hex($v) : $v }, display => sub { $o->{display} = $v }, askdisplay => sub { print "Please enter the X11 display to perform the install on ? "; $o->{display} = chomp_(scalar(<STDIN>)) }, text => sub { $o->{interactive} = "curses" }, stdio => sub { $o->{interactive} = "stdio" }, newt => sub { $o->{interactive} = "curses" }, simple_themes => sub { $o->{simple_themes} = 1 }, theme => sub { $o->{theme} = $v }, doc => sub { $o->{doc} = 1 }, #- will be used to know that we're running for the doc team, #- e.g. we want screenshots with a good B&W contrast security => sub { $o->{security} = $v }, # auto install options: noauto => sub { $::noauto = 1 }, testing => sub { $::testing = 1 }, patch => sub { $patch = 1 }, defcfg => sub { $cfg = $v }, kickstart => sub { $::auto_install = $v }, local_install => sub { $::local_install = 1 }, uml_install => sub { $::uml_install = $::local_install = 1 }, auto_install => sub { $::auto_install = $v }, # debugging options: useless_thing_accepted => sub { $o->{useless_thing_accepted} = 1 }, alawindows => sub { $o->{security} = 0; $o->{partitioning}{clearall} = 1; $o->{bootloader}{crushMbr} = 1 }, fdisk => sub { $o->{partitioning}{fdisk} = 1 }, nomouseprobe => sub { $o->{nomouseprobe} = $v }, updatemodules => sub { $o->{updatemodules} = 1 }, suppl => sub { $o->{supplmedia} = $v }, askmedia => sub { $o->{askmedia} = 1 }, restore => sub { $::isRestore = 1 }, compsslistlevel => sub { $o->{compssListLevel} = $v }, }}{lc $n}; &$f if $f; } %cmdline; ($cfg, $patch); } my ($cfg, $patch) = parse_args(@ARGV); output("o_old.pm", Dumper($o)); =back
View Attachment As Raw
Actions:
View
Attachments on
bug 20551
:
9135
|
9136
|
9137
| 9138 |
9139
|
9140
|
9141
|
9142
|
9143
|
9144
|
9145
|
9146