summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Expand)AuthorAgeFilesLines
* export blkid cache (small speedup)Thierry Vignaud2012-12-281-2/+3
* factorizeThierry Vignaud2012-12-281-11/+7
* add support for straceThierry Vignaud2012-12-231-0/+2
* rename $gdb as $wrapperThierry Vignaud2012-12-231-4/+4
* perl_checker cleanupThierry Vignaud2012-12-101-1/+1
* fix debugfs dir path and do not attempt to create it since it is already in s...Olivier Blin2012-09-011-4/+4
* more usbfs removal fixesThomas Backlund2012-09-011-1/+2
* - drakx-in-chroot:Thomas Backlund2012-09-011-2/+2
* drakx-in-chroot: unmount /dev in chrootOlivier Blin2012-05-061-1/+1
* installer: allow generation of host-only initrd during installColin Guthrie2012-04-101-2/+16
* text mode needs /dev/ttyThierry Vignaud2012-02-271-1/+1
* add .gitignore files so that empty directories end in archives createdThierry Vignaud2012-01-234-0/+4
* revert last changeThierry Vignaud2012-01-201-1/+1
* let's please vimThierry Vignaud2012-01-201-1/+1
* add support for --gdbThierry Vignaud2012-01-081-1/+15
* supplement blacklistThierry Vignaud2012-01-081-1/+3
* Synthesized commit during git-svn import combining previous Mandriva history ...Mageia SVN-Git Migration2011-02-069-300/+3
* (install) only run 'ldd' on files, not directory (fix some warnings atThierry Vignaud2010-02-031-1/+1
* properly fix FileHandle issuePascal Terjan2009-10-071-1/+2
* Include MDK::Common after XML::Parser as XML::Parser breaks if File::Sync was...Pascal Terjan2009-10-071-1/+1
* perl_checker cleanupThierry Vignaud2009-03-171-1/+0
* enable to emulate iso-on-disk installationThierry Vignaud2009-03-171-2/+15
* (create_initial_devices) copy /dev/*random tooThierry Vignaud2009-03-091-1/+1
* simplify previous commit (detect when @l becomes empty instead of not doingPascal Rigaux2008-10-231-7/+5
* do not uselessly wait on stdin if no files have to be filteredOlivier Blin2008-10-151-3/+5
* document --textThierry Vignaud2008-10-081-0/+1
* do not start an X server if using --textThierry Vignaud2008-10-081-1/+1
* drakx-in-chroot: do not require running kernel to be installed, generate empt...Olivier Blin2008-09-251-1/+1
* document --flangThierry Vignaud2008-08-291-0/+1
* remove debugging code that wrongly went in last commit (r244224 onThierry Vignaud2008-08-201-6/+1
* enable to use a package repository different from installer one; this enablesThierry Vignaud2008-08-191-2/+14
* enable to choose resolution of XvfbThierry Vignaud2008-08-191-2/+11
* prefer Xephyr over Xnest since Xnest lacks many extensions needed byThierry Vignaud2008-07-251-1/+1
* use unsquashfs \o/ (thanks blino)Pascal Rigaux2007-12-131-9/+4
* - ensure failing to build mdkinst.sqfs is a fatal errorPascal Rigaux2007-12-121-1/+1
* - drakx-in-chroot:Pascal Rigaux2007-12-121-2/+3
* draklive has been in /soft for agesOlivier Blin2007-10-151-1034/+0
* tag it as executableThierry Vignaud2007-08-291-0/+0
* use 127.0.0.1 instead of localhost Pascal Rigaux2007-08-211-1/+1
* make drakx-in-chroot work with new libldetect:Pascal Rigaux2007-08-071-1/+9
* re-sync after the big svn lossPascal Rigaux2007-04-2511-351/+164
* don't vivify regions arrayOlivier Blin2006-03-131-1/+1
* remove One specific stuffOlivier Blin2006-03-131-20/+0
* change system files option semantics (copy one file only, but allow to set it...Olivier Blin2006-03-131-2/+4
* document how mkcd must be patchedPascal Rigaux2006-03-101-0/+13
* modif needed to build ppc isos (10.1 and 10.2, though this is only committed ...Pascal Rigaux2006-03-101-0/+7
* now taken from /usr/lib/yaboot/yaboot (from pkg yaboot)Pascal Rigaux2006-03-101-0/+0
* mkcd should be used insteadPascal Rigaux2006-03-101-71/+0
* mkisofs can do the job nowPascal Rigaux2006-03-102-0/+0
* wait some seconds for the usb-stor-scan process to be runOlivier Blin2006-03-091-1/+4
selected} == 0) { push @$l, @{$i->{deps} || []}; } } #- garbage collect for circular dependencies my $changed = 1; while ($changed) { $changed = 0; NEXT: foreach my $p (grep { $_->{selected} > 0 && !$_->{base} } values %$packages) { my $set = set_new(@{$p->{provides}}); foreach (@{$set->{list}}) { my $q = Package($packages, $_); $q->{selected} == -1 || $q->{base} and next NEXT; set_add($set, @{$q->{provides}}) if $q->{selected}; } $p->{selected} = 0; $changed = 1; } } } sub toggle($$) { my ($packages, $p) = @_; $p->{selected} ? unselect($packages, $p) : &select($packages, $p); } sub set($$$) { my ($packages, $p, $val) = @_; $val ? &select($packages, $p) : unselect($packages, $p); } sub psUsingDirectory() { my $dirname = "/tmp/rhimage/Mandrake/RPMS"; my %packages; log::l("scanning $dirname for packages"); foreach (all("$dirname")) { my ($name, $version, $release) = /(.*)-([^-]+)-([^-.]+)\.[^.]+\.rpm/ or log::l("skipping $_"), next; $packages{$name} = { name => $name, version => $version, release => $release, file => $_, selected => 0, deps => [], }; } \%packages; } sub psUsingHdlist() { my $f = install_any::getFile('hdlist') or die "no hdlist found"; my %packages; # my ($noSeek, $end) = 0; # $end = sysseek F, 0, 2 or die "seek failed"; # sysseek F, 0, 0 or die "seek failed"; while (my $header = c::headerRead(fileno $f, 1)) { # or die "error reading header at offset ", sysseek(F, 0, 1); my $name = c::headerGetEntry($header, 'name'); $packages{$name} = { name => $name, header => $header, selected => 0, deps => [], version => c::headerGetEntry($header, 'version'), release => c::headerGetEntry($header, 'release'), size => c::headerGetEntry($header, 'size'), }; } log::l("psUsingHdlist read " . scalar keys(%packages) . " headers"); \%packages; } sub chop_version($) { first($_[0] =~ /(.*)-[^-]+-[^-.]+/) || $_[0]; } sub getDeps($) { my ($packages) = @_; my $f = install_any::getFile("depslist") or die "can't find dependencies list"; foreach (<$f>) { my ($name, $size, @deps) = split; ($name, @deps) = map { chop_version($_) } ($name, @deps); $packages->{$name} or next; $packages->{$name}{size} = $size; $packages->{$name}{deps} = \@deps; map { push @{$packages->{$_}{provides}}, $name if $packages->{$_} } @deps; } } sub readCompss($) { my ($packages) = @_; my (@compss, $ps); my $f = install_any::getFile("compss") or die "can't find compss"; foreach (<$f>) { /^\s*$/ || /^#/ and next; s/#.*//; my ($options, $name) = /^(\S*)\s+(.*?)\s*$/ or log::l("bad line in compss: $_"), next; if ($name =~ /(.*):$/) { $ps = []; push @compss, { options => $options, name => $1, packages => $ps }; } else { my $p = $packages->{$name} or log::l("unknown package $name (in compss)"), next; $p->{options} = $options; push @$ps, $p; } } \@compss; } sub readCompssList($) { my ($packages) = @_; my ($list, %compssList); my $f = install_any::getFile("compssList") or die "can't find compssList"; foreach (<$f>) { /^\s*$/ || /^#/ and next; if (/(.*):$/) { $compssList{$1} = $list = []; } else { chomp; my $p = $packages->{$_} or log::l("unknown package $_ (in compssList)"), next; push @$list, $p; } } \%compssList; } sub verif_lang($$) { my ($p, $lang) = @_; local $SIG{__DIE__} = 'none'; $p->{options} =~ /l/ or return 1; $p->{name} =~ /-([^-]*)$/ or return 1; !($1 eq $lang || eval { lang::text2lang($1) eq $lang } && !$@); } sub setShowFromCompss($$$) { my ($compss, $install_class, $lang) = @_; my $l = substr($install_class, 0, 1); foreach my $c (@$compss) { $c->{show} = bool($c->{options} =~ /($l|\*)/); foreach my $p (@{$c->{packages}}) { local $_ = $p->{options}; $p->{show} = /$l|\*/ && verif_lang($p, $lang); } } } sub setSelectedFromCompssList($$$$$) { my ($compssList, $packages, $size, $install_class, $lang) = @_; my $l = $compssList->{$install_class} or log::l("no $_ entry in compssList"), return; foreach (@$l) { verif_lang($_, $lang) or next; &select($packages, $_); my $nb = 0; foreach (values %$packages) { $nb += $_->{size} if $_->{selected}; } if ($nb > $size) { unselect($packages, $_); last; } } } sub init_db { my ($prefix, $isUpgrade) = @_; my $f = "$prefix/root/" . ($isUpgrade ? "upgrade" : "install") . ".log"; open(F, "> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); $fd = fileno(F) || log::fd() || 2; c::rpmErrorSetCallback($fd); # c::rpmSetVeryVerbose(); log::l("reading /usr/lib/rpm/rpmrc"); c::rpmReadConfigFiles() or die "can't read rpm config files"; log::l("\tdone"); $isUpgrade ? c::rpmdbRebuild($prefix) : c::rpmdbInit($prefix, 0644) or die "creation/rebuilding of rpm database failed: ", c::rpmErrorString(); } sub getHeader($) { my ($p) = @_; unless ($p->{header}) { my $f = install_any::getFile($p->{file}) or die "error opening package $p->{name} (file $p->{file})"; $p->{header} = c::rpmReadPackageHeader(fileno $f); } $p->{header}; } sub install { my ($prefix, $toInstall, $isUpgrade, $force) = @_; c::rpmReadConfigFiles() or die "can't read rpm config files"; my $db = c::rpmdbOpen($prefix) or die "error opening RPM database: ", c::rpmErrorString(); log::l("opened rpm database"); my $trans = c::rpmtransCreateSet($db, $prefix); my ($total, $nb); foreach my $p (@$toInstall) { getHeader($p) or next; $p->{installed} = 1; $p->{file} ||= sprintf "%s-%s-%s.%s.rpm", $p->{name}, $p->{version}, $p->{release}, c::headerGetEntry(getHeader($p), 'arch'); c::rpmtransAddPackage($trans, getHeader($p), $p->{file}, $isUpgrade); $nb++; $total += $p->{size}; } c::rpmdepOrder($trans) or c::rpmdbClose($db), c::rpmtransFree($trans), die "error ordering package list: ", c::rpmErrorString(); c::rpmtransSetScriptFd($trans, $fd); eval { fs::mount("/proc", "$prefix/proc", "proc", 0) }; log::ld("starting installation: ", $nb, " packages, ", $total, " bytes"); #- !! do not translate these messages, they are used when catched (cf install_steps_graphical) my $callbackOpen = sub { my $fd = install_any::getFile($_[0]) or log::l("bad file $_[0]"); $fd ? fileno $fd : -1; }; my $callbackClose = sub { }; my $callbackStart = sub { log::ld("starting installing package ", $_[0]) }; my $callbackProgress = sub { log::ld("progressing installation ", $_[0], "/", $_[1]) }; if (my @probs = c::rpmRunTransactions($trans, $callbackOpen, $callbackClose, $callbackStart, $callbackProgress, $force)) { my %parts; @probs = reverse grep { if (s/(installing package) .* (needs (?:.*) on the (.*) filesystem)/$1 $2/) { $parts{$3} ? 0 : ($parts{$3} = 1); } else { 1; } } reverse @probs; die "installation of rpms failed:\n ", join("\n ", @probs); } c::rpmtransFree($trans); c::rpmdbClose($db); log::l("rpm database closed"); }