#!/usr/bin/perl

# DiskDrake
# Copyright (C) 1999-2008 Mandriva (pixel@mandriva.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# DiskDrake uses resize_fat which is a perl rewrite of the work of Andrew
# Clausen (libresize).
# DiskDrake is also based upon the libfdisk and the install from Red Hat Software


use lib qw(/usr/lib/libDrakX);

use standalone;     #- warning, standalone must be loaded very first, for 'explanations'

use common;
use interactive;
use detect_devices;
use fsedit;
use fs;
use log;
use c;

$ugtk2::wm_icon = "/usr/share/mcc/themes/default/diskdrake_hd.png";

my %options;
my @l = @ARGV;
while (my $e = shift @l) {
    my ($option) = $e =~ /--?(.*)/ or next;
    if ($option =~ /(.*?)=(.*)/) {
	$options{$1} = $2;
    } else {
	$options{$option} = '';
    }
}

my @types = qw(hd nfs smb dav removable fileshare list-hd change-geometry);
my ($type, $para) = ('hd', '');
foreach (@types) {
    if (exists $options{$_}) {
        $para = delete $options{$_};
	$type = $_;
	last;
    }
}
keys %options and die "usage: diskdrake [--expert] [--testing] [--{" . join(",", @types) . "}]\n";

if ($>) {
    $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
}


my $in = 'interactive'->vnew('su');

if ($type eq 'fileshare') {
    require any;
    any::fileshare_config($in, '');
    $in->exit(0);
}

my $all_hds = fsedit::get_hds({}, $in);

fs::get_raw_hds('', $all_hds);

fs::get_info_from_fstab($all_hds);
fs::merge_info_from_mtab([ fs::get::really_all_fstab($all_hds) ]);

$all_hds->{current_fstab} = fs::fstab_to_string($all_hds, '');

if ($type eq 'list-hd') {
    print partition_table::description($_), "\n" foreach fs::get::fstab($all_hds);    
} elsif ($type eq 'change-geometry') {
    my ($device, undef, $heads, $sectors) = $para =~ /(.+)=(\d+,)?(\d+),(\d+)$/ or die "usage: diskdrake --change-geometry=<device>=[<cylinders>,]<heads>,<sectors>\n";
    my $hd = fs::get::device2part($device, $all_hds->{hds});
    put_in_hash($hd->{geom}, { heads => $heads, sectors => $sectors });
    $hd->{isDirty} = 1;
    partition_table::write($hd);
} elsif ($type eq 'hd') {
    require diskdrake::interactive;
    diskdrake::interactive::main($in, $all_hds, '');
} elsif ($type eq 'removable') {
    require diskdrake::removable;
    my ($raw_hd) = $para ?
      fs::get::device2part($para, $all_hds->{raw_hds}) || die "unknown removable $para\n" :
      $in->ask_from_listf('', '', \&diskdrake::interactive::format_raw_hd_info, $all_hds->{raw_hds}) or $in->exit(0);

    if (!$raw_hd->{mntpoint}) {
	my $mntpoint = detect_devices::suggest_mount_point($raw_hd);
	$raw_hd->{mntpoint} ||= find { !fs::get::has_mntpoint($_, $all_hds) } map { "/media/$mntpoint$_" } '', 2 .. 10;
	$raw_hd->{is_removable} = 1; #- force removable flag

	require security::level;
	require lang;
	fs::mount_options::set_default($raw_hd, 
				security => security::level::get(), 
				lang::fs_options(lang::read()));
    }
    diskdrake::removable::main($in, $all_hds, $raw_hd);
} elsif ($type eq 'dav') {
    require diskdrake::dav;
    diskdrake::dav::main($in, $all_hds);
} else {
    $in->ask_warn('', "Sorry only a gtk frontend is available") if !$in->isa('interactive::gtk');
    require diskdrake::smbnfs_gtk;
    diskdrake::smbnfs_gtk::main($in, $all_hds, $type);
}

$in->exit(0);
>
<option value='user/erwan/bug-13680'>user/erwan/bug-13680</option>
<option value='user/jibz/aarch64'>user/jibz/aarch64</option>
<option value='user/martinw/mga6'>user/martinw/mga6</option>
<option value='user/pterjan/arm64'>user/pterjan/arm64</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Mageia Installer and base platform for many utilities</td><td class='sub right'>Thierry Vignaud [tv]</td></tr></table>
<table class='tabs'><tr><td>
<a href='/software/drakx/?h=2.33'>summary</a><a href='/software/drakx/refs/?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>refs</a><a href='/software/drakx/log/perl-install?h=2.33'>log</a><a href='/software/drakx/tree/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>tree</a><a class='active' href='/software/drakx/commit/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>commit</a><a href='/software/drakx/diff/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>diff</a><a href='/software/drakx/stats/perl-install?h=2.33'>stats</a></td><td class='form'><form class='right' method='get' action='/software/drakx/log/perl-install'>
<input type='hidden' name='h' value='2.33'/><input type='hidden' name='id' value='9f8734e27c9a88137a2933970b7a5962e37789da'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/software/drakx/commit/?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>root</a>/<a href='/software/drakx/commit/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='2.33'/><input type='hidden' name='id' value='9f8734e27c9a88137a2933970b7a5962e37789da'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Pascal Rigaux &lt;pixel@mandriva.com&gt;</td><td class='right'>1999-07-16 14:03:47 +0000</td></tr>
<tr><th>committer</th><td>Pascal Rigaux &lt;pixel@mandriva.com&gt;</td><td class='right'>1999-07-16 14:03:47 +0000</td></tr>
<tr><th>commit</th><td colspan='2' class='sha1'><a href='/software/drakx/commit/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>9f8734e27c9a88137a2933970b7a5962e37789da</a> (<a href='/software/drakx/patch/perl-install?id=9f8734e27c9a88137a2933970b7a5962e37789da'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='sha1'><a href='/software/drakx/tree/?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>973e9a5518a38231812f2af8047ca93be420a083</a> /<a href='/software/drakx/tree/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install</a></td></tr>
<tr><th>parent</th><td colspan='2' class='sha1'><a href='/software/drakx/commit/perl-install?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999</a> (<a href='/software/drakx/diff/perl-install?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da&amp;id2=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>diff</a>)</td></tr><tr><th>download</th><td colspan='2' class='sha1'><a href='/software/drakx/snapshot/drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar'>drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar</a><br/><a href='/software/drakx/snapshot/drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.gz'>drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.gz</a><br/><a href='/software/drakx/snapshot/drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.bz2'>drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.bz2</a><br/><a href='/software/drakx/snapshot/drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.xz'>drakx-9f8734e27c9a88137a2933970b7a5962e37789da.tar.xz</a><br/><a href='/software/drakx/snapshot/drakx-9f8734e27c9a88137a2933970b7a5962e37789da.zip'>drakx-9f8734e27c9a88137a2933970b7a5962e37789da.zip</a><br/></td></tr></table>
<div class='commit-subject'>*** empty log message ***</div><div class='commit-msg'></div><div class='diffstat-header'><a href='/software/drakx/diff/?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>Diffstat</a> (limited to 'perl-install')</div><table summary='diffstat' class='diffstat'><tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/Makefile?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/Makefile</a></td><td class='right'>10</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 6.0%;'/><td class='rem' style='width: 4.0%;'/><td class='none' style='width: 90.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/install2.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install2.pm</a></td><td class='right'>100</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 61.0%;'/><td class='rem' style='width: 39.0%;'/><td class='none' style='width: 0.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/install_steps.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install_steps.pm</a></td><td class='right'>11</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 11.0%;'/><td class='rem' style='width: 0.0%;'/><td class='none' style='width: 89.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/install_steps_stdio.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install_steps_stdio.pm</a></td><td class='right'>30</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 13.0%;'/><td class='rem' style='width: 17.0%;'/><td class='none' style='width: 70.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/my_gtk.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/my_gtk.pm</a></td><td class='right'>10</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 4.0%;'/><td class='rem' style='width: 6.0%;'/><td class='none' style='width: 90.0%;'/></tr></table></td></tr>
<tr><td class='mode'>-rw-r--r--</td><td class='upd'><a href='/software/drakx/diff/perl-install/pkgs.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/pkgs.pm</a></td><td class='right'>4</td><td class='graph'><table summary='file diffstat' width='100%'><tr><td class='add' style='width: 3.0%;'/><td class='rem' style='width: 1.0%;'/><td class='none' style='width: 96.0%;'/></tr></table></td></tr>
</table><div class='diffstat-summary'>6 files changed, 98 insertions, 67 deletions</div><table summary='diff' class='diff'><tr><td><div class='head'>diff --git a/perl-install/Makefile b/perl-install/Makefile<br/>index 220488b25..3773961d1 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/Makefile?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/Makefile</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/Makefile?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/Makefile</a></div><div class='hunk'>@@ -4,6 +4,7 @@ DEST = /tmp/t/Mandrake/instimage</div><div class='ctx'> DESTREP4PMS = $(DEST)/usr/bin/perl-install</div><div class='ctx'> PERL = perl</div><div class='ctx'> LOCALFILES = $(PERL) mouseconfig fr.map</div><div class='add'>+EXCLUDE = $(LOCALFILES) boot-hd.img</div><div class='ctx'> </div><div class='ctx'> .PHONY: all tags install clean verify_c</div><div class='ctx'> </div><div class='hunk'>@@ -14,11 +15,11 @@ tags:</div><div class='ctx'> </div><div class='ctx'> clean:</div><div class='ctx'> 	test ! -e c/Makefile || $(MAKE) -C c clean</div><div class='del'>-	rm -f c/c.xs</div><div class='add'>+	rm -f c/c.xs install1_hd</div><div class='ctx'> 	find . -name "*~" -o -name "TAGS" -o -name "*.old" | xargs rm -f</div><div class='ctx'> </div><div class='ctx'> tar: clean</div><div class='del'>-	cd .. ; tar cfy perl-install.tar.bz2 $(LOCALFILES:%=--exclude %) perl-install</div><div class='add'>+	cd .. ; tar cfy perl-install.tar.bz2 $(EXCLUDE:%=--exclude %) perl-install</div><div class='ctx'> </div><div class='ctx'> tar-diskdrake: clean</div><div class='ctx'> 	cd .. ; rm -rf diskdrake ; cp -af perl-install diskdrake</div><div class='hunk'>@@ -112,13 +113,14 @@ as_root:</div><div class='ctx'> </div><div class='ctx'> full_stage2:</div><div class='ctx'> 	rm -rf $(DEST)</div><div class='del'>-	mkdir $(DEST)</div><div class='add'>+	mkdir -p $(DEST)</div><div class='ctx'> 	$(MAKE) get_needed_files </div><div class='ctx'> 	$(MAKE) stage2</div><div class='ctx'> </div><div class='ctx'> stage2:</div><div class='ctx'> 	$(MAKE) install_pms</div><div class='del'>-	cd $(DEST) ; tar cfz $(DEST).tgz [^M]* ; mv $(DEST).tgz /tmp/t.tgz</div><div class='add'>+	cd /tmp/t ; tar cfz /tmp/instimage-full.tgz Mandrake</div><div class='add'>+	cd /tmp/t ; tar cfz /tmp/instimage-light.tgz Mandrake/instimage/usr/[bl]*</div><div class='ctx'> </div><div class='ctx'> 	@#rm -rf /mnt/initrd/*</div><div class='ctx'> 	@#cp -a $(DEST)/* /mnt/initrd</div><div class='head'>diff --git a/perl-install/install2.pm b/perl-install/install2.pm<br/>index 4ae7c89b8..859e46e30 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/install2.pm?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/install2.pm</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/install2.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install2.pm</a></div><div class='hunk'>@@ -21,47 +21,53 @@ use partition_table qw(:types);</div><div class='ctx'> use detect_devices;</div><div class='ctx'> use smp;</div><div class='ctx'> </div><div class='del'>-$testing = $ENV{PERL_INSTALL_TEST};</div><div class='add'>+$testing = 1;#$ENV{PERL_INSTALL_TEST};</div><div class='ctx'> $INSTALL_VERSION = 0;</div><div class='ctx'> </div><div class='del'>-my @installStepsFields = qw(text skipOnCancel skipOnLocal prev next);</div><div class='add'>+my @installStepsFields = qw(text help skipOnCancel skipOnLocal prev next);</div><div class='ctx'> my @installSteps = (</div><div class='del'>-  selectInstallClass =&gt; [ "Select installation class", 0, 0 ],</div><div class='del'>-  setupSCSI =&gt; [ "Setup SCSI", 0, 1 ],	</div><div class='del'>-  partitionDisks =&gt; [ "Setup filesystems", 0, 1 ],</div><div class='del'>-  findInstallFiles =&gt; [ "Find installation files", 1, 0 ],</div><div class='del'>-  choosePackages =&gt; [ "Choose packages to install", 0, 0 ],</div><div class='del'>-  doInstallStep =&gt; [ "Install system", 0, 0 ],</div><div class='del'>-#  configureMouse =&gt; [ "Configure mouse", 0, 0 ],</div><div class='del'>-  finishNetworking =&gt; [ "Configure networking", 0, 0 ],</div><div class='del'>-#  configureTimezone =&gt; [ "Configure timezone", 0, 0 ],</div><div class='del'>-#  configureServices =&gt; [ "Configure services", 0, 0 ],</div><div class='del'>-#  configurePrinter =&gt; [ "Configure printer", 0, 0 ],</div><div class='del'>-  setRootPassword =&gt; [ "Set root password", 0, 0 ],</div><div class='del'>-  addUser =&gt; [ "Add a user", 0, 0 ],</div><div class='del'>-  createBootdisk =&gt; [ "Create bootdisk", 0, 1 ],</div><div class='del'>-  setupBootloader =&gt; [ "Install bootloader", 0, 1 ],</div><div class='del'>-#  configureX =&gt; [ "Configure X", 0, 0 ],</div><div class='del'>-  exitInstall =&gt; [ "Exit install", 0, 0, undef, 'done' ],</div><div class='add'>+  selectLanguage =&gt; [ "Choose your language", "aide", 0, 0 ],</div><div class='add'>+  selectPath =&gt; [ "Choose install or upgrade", "aide", 0, 0 ],</div><div class='add'>+  selectInstallClass =&gt; [ "Select installation class", "aide", 0, 0 ],</div><div class='add'>+  setupSCSI =&gt; [ "Setup SCSI", "aide", 0, 1 ],	</div><div class='add'>+  partitionDisks =&gt; [ "Setup filesystems", "aide", 0, 1 ],</div><div class='add'>+  findInstallFiles =&gt; [ "Find installation files", "aide", 1, 0 ],</div><div class='add'>+  choosePackages =&gt; [ "Choose packages to install", "aide", 0, 0 ],</div><div class='add'>+  doInstallStep =&gt; [ "Install system", "aide", 0, 0 ],</div><div class='add'>+#  configureMouse =&gt; [ "Configure mouse", "aide", 0, 0 ],</div><div class='add'>+  finishNetworking =&gt; [ "Configure networking", "aide", 0, 0 ],</div><div class='add'>+#  configureTimezone =&gt; [ "Configure timezone", "aide", 0, 0 ],</div><div class='add'>+#  configureServices =&gt; [ "Configure services", "aide", 0, 0 ],</div><div class='add'>+#  configurePrinter =&gt; [ "Configure printer", "aide", 0, 0 ],</div><div class='add'>+  setRootPassword =&gt; [ "Set root password", "aide", 0, 0 ],</div><div class='add'>+  addUser =&gt; [ "Add a user", "aide", 0, 0 ],</div><div class='add'>+  createBootdisk =&gt; [ "Create bootdisk", "aide", 0, 1 ],</div><div class='add'>+  setupBootloader =&gt; [ "Install bootloader", "aide", 0, 1 ],</div><div class='add'>+#  configureX =&gt; [ "Configure X", "aide", 0, 0 ],</div><div class='add'>+  exitInstall =&gt; [ "Exit install", "aide", 0, 0, undef, 'done' ],</div><div class='ctx'> );</div><div class='ctx'> </div><div class='ctx'> # this table is translated at run time</div><div class='ctx'> my @upgradeSteps = (</div><div class='del'>-  setupSCSI =&gt; [ "Setup SCSI", 0, 0 ],</div><div class='del'>-  upgrFindInstall =&gt; [ "Find current installation", 0, 0 ],</div><div class='del'>-  findInstallFiles =&gt; [ "Find installation files", 1, 0 ],</div><div class='del'>-  upgrChoosePackages =&gt; [ "Choose packages to upgrade", 0, 0 ],</div><div class='del'>-  doInstallStep =&gt; [ "Upgrade system", 0, 0 ],</div><div class='del'>-  createBootdisk =&gt; [ "Create bootdisk", 0, 0 , 'none' ],</div><div class='del'>-  setupBootloader =&gt; [ "Install bootloader", 0, 0 ],</div><div class='del'>-  exitInstall =&gt; [ "Exit install", 0, 0 , undef, 'done' ],</div><div class='add'>+  selectLanguage =&gt; [ "Choose your language", "aide", 0, 0 ],</div><div class='add'>+  selectPath =&gt; [ "Choose install or upgrade", "aide", 0, 0 ],</div><div class='add'>+  selectInstallClass =&gt; [ "Select installation class", "aide", 0, 0 ],</div><div class='add'>+  setupSCSI =&gt; [ "Setup SCSI", "aide", 0, 0 ],</div><div class='add'>+  upgrFindInstall =&gt; [ "Find current installation", "aide", 0, 0 ],</div><div class='add'>+  findInstallFiles =&gt; [ "Find installation files", "aide", 1, 0 ],</div><div class='add'>+  upgrChoosePackages =&gt; [ "Choose packages to upgrade", "aide", 0, 0 ],</div><div class='add'>+  doInstallStep =&gt; [ "Upgrade system", "aide", 0, 0 ],</div><div class='add'>+  createBootdisk =&gt; [ "Create bootdisk", "aide", 0, 0 , 'none' ],</div><div class='add'>+  setupBootloader =&gt; [ "Install bootloader", "aide", 0, 0 ],</div><div class='add'>+  exitInstall =&gt; [ "Exit install", "aide", 0, 0 , undef, 'done' ],</div><div class='ctx'> );</div><div class='del'>-my (%installSteps, %upgradeSteps);</div><div class='add'>+my (%installSteps, %upgradeSteps, @orderedInstallSteps, @orderedUpgradeSteps);</div><div class='ctx'> for (my $i = 0; $i &lt; @installSteps; $i += 2) {</div><div class='ctx'>     my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };</div><div class='ctx'>     $h{prev} ||= $installSteps[$i - 2];</div><div class='ctx'>     $h{next} ||= $installSteps[$i + 2];</div><div class='ctx'>     $installSteps{ $installSteps[$i] } = \%h;</div><div class='add'>+    push @orderedInstallSteps, $installSteps[$i];</div><div class='ctx'> }</div><div class='ctx'> $installSteps{first} = $installSteps[0];</div><div class='ctx'> for (my $i = 0; $i &lt; @upgradeSteps; $i += 2) {</div><div class='hunk'>@@ -69,6 +75,7 @@ for (my $i = 0; $i &lt; @upgradeSteps; $i += 2) {</div><div class='ctx'>     $h{prev} ||= $upgradeSteps[$i - 2];</div><div class='ctx'>     $h{next} ||= $upgradeSteps[$i + 2];</div><div class='ctx'>     $upgradeSteps{ $upgradeSteps[$i] } = \%h;</div><div class='add'>+    push @orderedUpgradeSteps, $installSteps[$i];</div><div class='ctx'> }</div><div class='ctx'> $upgradeSteps{first} = $upgradeSteps[0];</div><div class='ctx'> </div><div class='hunk'>@@ -103,12 +110,17 @@ my $default = {</div><div class='ctx'> 	     ],</div><div class='ctx'>     shells =&gt; [ map { "/bin/$_" } qw(bash tcsh zsh ash) ],</div><div class='ctx'> };</div><div class='del'>-$o = { default =&gt; $default };</div><div class='add'>+$o = { default =&gt; $default, steps =&gt; \%installSteps, orderedSteps =&gt; \@orderedInstallSteps };</div><div class='ctx'> </div><div class='ctx'> </div><div class='add'>+sub selectLanguage {</div><div class='add'>+    $o-&gt;{lang} = $o-&gt;chooseLanguage;</div><div class='add'>+}</div><div class='add'>+</div><div class='ctx'> sub selectPath {</div><div class='ctx'>     $o-&gt;{isUpgrade} = $o-&gt;selectInstallOrUpgrade;</div><div class='del'>-    $o-&gt;{steps} = $o-&gt;{isUpgrade} ? \%upgradeSteps : \%installSteps;</div><div class='add'>+    $o-&gt;{steps}        = $o-&gt;{isUpgrade} ? \%upgradeSteps : \%installSteps;</div><div class='add'>+    $o-&gt;{orderedSteps} = $o-&gt;{isUpgrade} ? \@orderedUpgradeSteps : \@orderedInstallSteps;</div><div class='ctx'> }</div><div class='ctx'> </div><div class='ctx'> sub selectInstallClass {</div><div class='hunk'>@@ -170,9 +182,15 @@ sub findInstallFiles {</div><div class='ctx'>     $o-&gt;{comps} = $o-&gt;{method}-&gt;getComponentSet($o-&gt;{packages});</div><div class='ctx'> }</div><div class='ctx'>  </div><div class='del'>-sub choosePackages { </div><div class='add'>+sub choosePackages {</div><div class='add'>+    # remove Base from comps so that it's hidden</div><div class='add'>+    my $base = $o-&gt;{comps}-&gt;{Base};</div><div class='add'>+    delete $o-&gt;{comps}-&gt;{Base};</div><div class='add'>+</div><div class='ctx'>     $o-&gt;choosePackages($o-&gt;{packages}, $o-&gt;{comps}); </div><div class='ctx'> </div><div class='add'>+    #restore Base</div><div class='add'>+    $o-&gt;{comps}-&gt;{Base} = $base;</div><div class='ctx'>     $o-&gt;{comps}-&gt;{Base}-&gt;{selected} = 1;</div><div class='ctx'> </div><div class='ctx'>     foreach (grep { $_-&gt;{selected} } values %{$o-&gt;{comps}}) {</div><div class='hunk'>@@ -208,7 +226,15 @@ sub setupBootloader {</div><div class='ctx'> </div><div class='ctx'> sub configureX { $o-&gt;setupXfree; }</div><div class='ctx'> </div><div class='del'>-sub exitInstall { $o-&gt;exitInstall }</div><div class='add'>+sub exitInstall { </div><div class='add'>+    $o-&gt;warn( </div><div class='add'>+"Congratulations, installation is complete.</div><div class='add'>+Remove the boot media and press return to reboot.</div><div class='add'>+For information on fixes which are available for this release of Linux Mandrake,</div><div class='add'>+consult the Errata available from http://www.linux-mandrake.com/.</div><div class='add'>+Information on configuring your system is available in the post</div><div class='add'>+install chapter of the Official Linux Mandrake User's Guide.");</div><div class='add'>+}</div><div class='ctx'> </div><div class='ctx'> sub main {</div><div class='ctx'>     $SIG{__DIE__} = sub { chomp $_[0]; log::l("ERROR: $_[0]") };</div><div class='hunk'>@@ -235,8 +261,6 @@ sub main {</div><div class='ctx'> </div><div class='ctx'>     $o = install_steps_graphical-&gt;new($o);</div><div class='ctx'> </div><div class='del'>-    $o-&gt;{lang} = $o-&gt;chooseLanguage;</div><div class='del'>-</div><div class='ctx'>     $o-&gt;{netc} = net::readNetConfig("/tmp");</div><div class='ctx'>     if (my ($file) = glob_('/tmp/ifcfg-*')) {</div><div class='ctx'> 	log::l("found network config file $file");</div><div class='hunk'>@@ -252,12 +276,10 @@ sub main {</div><div class='ctx'> </div><div class='ctx'>     $o-&gt;{keyboard} = eval { keyboard::read("/tmp/keyboard") } || $default-&gt;{keyboard};</div><div class='ctx'> </div><div class='del'>-    selectPath();</div><div class='del'>-</div><div class='ctx'>     for (my $step = $o-&gt;{steps}-&gt;{first}; $step ne 'done'; $step = getNextStep($step)) {</div><div class='del'>-	log::l("entering step $step");</div><div class='del'>-	&amp;{$main::{$step}}() and $o-&gt;{steps}-&gt;{completed} = 1;</div><div class='del'>-	log::l("step $step finished");</div><div class='add'>+	$o-&gt;enteringStep($step);</div><div class='add'>+	&amp;{$main::{$step}}() and $o-&gt;{steps}-&gt;{$step}-&gt;{completed} = 1;</div><div class='add'>+	$o-&gt;leavingStep($step);</div><div class='ctx'>     }</div><div class='ctx'>     killCardServices();</div><div class='ctx'> </div><div class='head'>diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm<br/>index 779a3bbc4..b64952370 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/install_steps.pm?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/install_steps.pm</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/install_steps.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install_steps.pm</a></div><div class='hunk'>@@ -22,12 +22,23 @@ my $o;</div><div class='ctx'> 1;</div><div class='ctx'> </div><div class='ctx'> </div><div class='add'>+sub warn {}</div><div class='add'>+</div><div class='ctx'> sub new($$) {</div><div class='ctx'>     my ($type, $o_) = @_;</div><div class='ctx'> </div><div class='ctx'>     $o = bless $o_, ref $type || $type;</div><div class='ctx'> }</div><div class='ctx'> </div><div class='add'>+sub enteringStep($$) {</div><div class='add'>+    my ($o, $step) = @_;</div><div class='add'>+    log::l("starting step `$step'");</div><div class='add'>+}</div><div class='add'>+sub leavingStep($$) {</div><div class='add'>+    my ($o, $step) = @_;</div><div class='add'>+    log::l("step `$step' finished");</div><div class='add'>+}</div><div class='add'>+</div><div class='ctx'> sub chooseLanguage($) {</div><div class='ctx'> #    eval { run_program::run('loadkeys', "/tmp/$o-&gt;{default}-&gt;{lang}) }; $@ and log::l("loadkeys failed");</div><div class='ctx'>     $o-&gt;{default}-&gt;{lang};</div><div class='head'>diff --git a/perl-install/install_steps_stdio.pm b/perl-install/install_steps_stdio.pm<br/>index c752e62df..44de0dd60 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/install_steps_stdio.pm?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/install_steps_stdio.pm</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/install_steps_stdio.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/install_steps_stdio.pm</a></div><div class='hunk'>@@ -18,6 +18,15 @@ use log;</div><div class='ctx'> </div><div class='ctx'> 1;</div><div class='ctx'> </div><div class='add'>+sub enteringStep($$$) {</div><div class='add'>+    my ($o, $step) = @_;</div><div class='add'>+    print "Starting step `$o-&gt;{steps}-&gt;{$step}-&gt;{text}'\n";</div><div class='add'>+}</div><div class='add'>+sub leavingStep {</div><div class='add'>+    my ($o) = @_;</div><div class='add'>+    print "--------\n";</div><div class='add'>+}</div><div class='add'>+</div><div class='ctx'> sub chooseLanguage($) {</div><div class='ctx'>     my $lang = ask_from_list('Language', 'Which language do you want?', [ lang::list() ]);</div><div class='ctx'>     run_program::run('xmodmap', "/usr/bin/$lang.map");</div><div class='hunk'>@@ -120,18 +129,6 @@ the Mandrake rescue image, making it much easier to recover from severe system</div><div class='ctx'> failures. Would you like to create a bootdisk for your system?");</div><div class='ctx'> }</div><div class='ctx'> </div><div class='del'>-sub exitInstall {</div><div class='del'>-    ask_warn('', </div><div class='del'>-"Congratulations, installation is complete.</div><div class='del'>-Remove the boot media and press return to reboot.</div><div class='del'>-For information on fixes which are available for this release of Linux Mandrake,</div><div class='del'>-consult the Errata available from http://www.linux-mandrake.com/.</div><div class='del'>-Information on configuring your system is available in the post</div><div class='del'>-install chapter of the Official Linux Mandrake User's Guide.");</div><div class='del'>-}</div><div class='del'>-</div><div class='del'>-</div><div class='del'>-</div><div class='ctx'> sub readln {</div><div class='ctx'>     my $l = &lt;STDIN&gt;;</div><div class='ctx'>     chomp $l;</div><div class='hunk'>@@ -140,13 +137,12 @@ sub readln {</div><div class='ctx'> </div><div class='ctx'> sub ask_warn {</div><div class='ctx'>     my ($title, @msgs) = @_;</div><div class='del'>-    print "----------\n", map { "$_\n" } @_;</div><div class='del'>-    print "Press enter"; readln();</div><div class='add'>+    warn(@msgs);</div><div class='ctx'> }</div><div class='ctx'> </div><div class='ctx'> sub ask_yesorno {</div><div class='ctx'>     my ($title, @msgs) = @_;</div><div class='del'>-    print "----------\n", join("\n", @_);</div><div class='add'>+    print join("\n", @_);</div><div class='ctx'>     print " (yes/No) "; readln() =~ /y/i;</div><div class='ctx'> </div><div class='ctx'> }</div><div class='hunk'>@@ -159,7 +155,7 @@ sub check_it {</div><div class='ctx'> sub ask_from_list {</div><div class='ctx'>     my ($title, @msgs) = @_;</div><div class='ctx'>     my $list = pop @msgs;</div><div class='del'>-    print "----------\n", map { "$_\n" } @msgs;</div><div class='add'>+    print map { "$_\n" } @msgs;</div><div class='ctx'>     my $n = 0; foreach (@$list) { $n++; print "$n: $_\n"; }</div><div class='ctx'>     my $i;</div><div class='ctx'>     do {</div><div class='hunk'>@@ -175,7 +171,7 @@ sub ask_many_from_list {</div><div class='ctx'>     my $default = pop @msgs;</div><div class='ctx'>     my $list = pop @msgs;</div><div class='ctx'>     my @defaults;</div><div class='del'>-    print "----------\n", map { "$_\n" } @msgs;</div><div class='add'>+    print map { "$_\n" } @msgs;</div><div class='ctx'>     my $n = 0; foreach (@$list) { </div><div class='ctx'> 	$n++; </div><div class='ctx'> 	print "$n: $_\n"; </div><div class='head'>diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm<br/>index 99636cf21..778cf53cb 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/my_gtk.pm?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/my_gtk.pm</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/my_gtk.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/my_gtk.pm</a></div><div class='hunk'>@@ -204,6 +204,7 @@ sub _create_window($$) {</div><div class='ctx'>     $o-&gt;{window}-&gt;set_title($title);</div><div class='ctx'>     $o-&gt;{window}-&gt;signal_connect("expose_event" =&gt; sub { c::XSetInputFocus($o-&gt;{window}-&gt;window-&gt;XWINDOW) }) if $my_gtk::force_focus; </div><div class='ctx'>     $o-&gt;{window}-&gt;signal_connect("delete_event" =&gt; sub { $o-&gt;{retval} = undef; Gtk-&gt;main_quit });</div><div class='add'>+    $o-&gt;{window}-&gt;set_uposition(@$my_gtk::force_position) if $my_gtk::force_position;</div><div class='ctx'>     $o-&gt;{window}</div><div class='ctx'> }</div><div class='ctx'> </div><div class='hunk'>@@ -241,16 +242,13 @@ sub _ask_from_entry($$@) {</div><div class='ctx'> sub _ask_from_list($$$@) {</div><div class='ctx'>     my ($o, $l, @msgs) = @_;</div><div class='ctx'>     my $list = new Gtk::List;</div><div class='add'>+    my @sorted = sort @$l;</div><div class='ctx'>     $list-&gt;signal_connect(select_child =&gt; sub { </div><div class='del'>-	$o-&gt;{retval} = $l-&gt;[$list-&gt;child_position($_[1])];</div><div class='add'>+	$o-&gt;{retval} = $sorted[$list-&gt;child_position($_[1])];</div><div class='ctx'> 	Gtk-&gt;main_quit;</div><div class='ctx'>     });</div><div class='del'>-    gtkadd($list, map { new Gtk::ListItem($_) } @$l);</div><div class='add'>+    gtkadd($list, map { new Gtk::ListItem($_) } @sorted);</div><div class='ctx'> </div><div class='del'>-#    myadd($o-&gt;{window}, </div><div class='del'>-#	   mypack_(myset_usize(new Gtk::VBox(0,0), 0, 200),</div><div class='del'>-#		   0, $o-&gt;create_box_with_title(@msgs), </div><div class='del'>-#		   1, createScrolledWindow(mypack(new Gtk::VBox(0,0), @l))));</div><div class='ctx'>     gtkadd($o-&gt;{window}, gtkpack($o-&gt;create_box_with_title(@msgs), $list));</div><div class='ctx'> }</div><div class='ctx'> </div><div class='head'>diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm<br/>index 103af1ec3..d512c7c5a 100644<br/>--- a/<a href='/software/drakx/tree/perl-install/pkgs.pm?h=2.33&amp;id=e4fb0c6d7fbe0fc8f8659f0d39510aad4dc95999'>perl-install/pkgs.pm</a><br/>+++ b/<a href='/software/drakx/tree/perl-install/pkgs.pm?h=2.33&amp;id=9f8734e27c9a88137a2933970b7a5962e37789da'>perl-install/pkgs.pm</a></div><div class='hunk'>@@ -21,7 +21,9 @@ sub skipThisPackage { member($_[0], @skipThesesPackages) }</div><div class='ctx'> sub addInfosFromHeader($$) {</div><div class='ctx'>     my ($packages, $header) = @_;</div><div class='ctx'> </div><div class='del'>-    $packages-&gt;{c::headerGetEntry($header, 'name')} = {</div><div class='add'>+    my $name = c::headerGetEntry($header, 'name');</div><div class='add'>+    $packages-&gt;{$name} = {</div><div class='add'>+        name =&gt; $name,</div><div class='ctx'> 	header =&gt; $header, size =&gt; c::headerGetEntry($header, 'size'),</div><div class='ctx'> 	group =&gt; c::headerGetEntry($header, 'group') || "(unknown group)",</div><div class='ctx'>     };</div></td></tr></table></div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.1</a> (<a href='https://git-scm.com/'>git 2.21.0</a>) at 2025-03-07 13:32:05 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>