summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-21 14:08:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-21 14:08:43 +0000
commit859695925c701d7408c0f97825512e2260998fd2 (patch)
treed6e8d6c2ef903bebd5d9c235bc8922cc86ac3f29
parent1275f71751148da1433ab6cc0c69124fb3d05baa (diff)
downloaddrakx-859695925c701d7408c0f97825512e2260998fd2.tar
drakx-859695925c701d7408c0f97825512e2260998fd2.tar.gz
drakx-859695925c701d7408c0f97825512e2260998fd2.tar.bz2
drakx-859695925c701d7408c0f97825512e2260998fd2.tar.xz
drakx-859695925c701d7408c0f97825512e2260998fd2.zip
don't pass prefix, use $::prefix
-rw-r--r--perl-install/crypto.pm8
-rw-r--r--perl-install/install_any.pm33
-rw-r--r--perl-install/install_steps.pm21
-rw-r--r--perl-install/install_steps_gtk.pm2
-rw-r--r--perl-install/install_steps_interactive.pm6
-rw-r--r--perl-install/pkgs.pm96
6 files changed, 79 insertions, 87 deletions
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index 670661429..cd04bdef9 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -138,7 +138,7 @@ sub getFile {
}
sub getPackages {
- my ($prefix, $packages, $mirror) = @_;
+ my ($packages, $mirror) = @_;
$crypto::host = $mirror;
@@ -158,7 +158,7 @@ sub getPackages {
#- extract hdlist of crypto, then depslist.
require pkgs;
- my $update_medium = pkgs::psUsingHdlist($prefix, 'ftp', $packages, "hdlist-updates.cz", "1u", "",
+ my $update_medium = pkgs::psUsingHdlist('ftp', $packages, "hdlist-updates.cz", "1u", "",
"Updates for Mandrakelinux " . version(), 1, $fhdlist, $pubkey);
if ($update_medium) {
log::l("read updates hdlist");
@@ -170,8 +170,8 @@ sub getPackages {
$update_medium->{update} = 1;
#- search for packages to update.
- $packages->{rpmdb} ||= pkgs::rpmDbOpen($prefix);
- pkgs::selectPackagesToUpgrade($packages, $prefix, $update_medium);
+ $packages->{rpmdb} ||= pkgs::rpmDbOpen();
+ pkgs::selectPackagesToUpgrade($packages, $update_medium);
}
return $update_medium;
}
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 7324c087e..5e163c409 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -246,7 +246,7 @@ sub setup_postinstall_rpms($$) {
my %toCopy;
#- compute closure of package that may be copied, use INSTALL category
#- in rpmsrate.
- $packages->{rpmdb} ||= pkgs::rpmDbOpen($prefix);
+ $packages->{rpmdb} ||= pkgs::rpmDbOpen();
foreach (@{$packages->{needToCopy} || []}) {
my $p = pkgs::packageByName($packages, $_) or next;
pkgs::selectPackage($packages, $p, 0, \%toCopy);
@@ -545,7 +545,6 @@ sub selectSupplMedia {
return 'error';
}
my $supplmedium = pkgs::psUsingHdlist(
- $o->{prefix},
$suppl_method,
$o->{packages},
"hdlist$medium_name.cz", #- hdlist
@@ -613,7 +612,7 @@ sub setPackages {
1 while $suppl_method = $o->selectSupplMedia($suppl_method);
#- open rpm db according to right mode needed.
- $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}, $rebuild_needed);
+ $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($rebuild_needed);
#- always try to select basic kernel (else on upgrade, kernel will never be updated provided a kernel is already
#- installed and provides what is necessary).
@@ -632,10 +631,10 @@ sub setPackages {
} else {
#- this has to be done to make sure necessary files for urpmi are
#- present.
- pkgs::psUpdateHdlistsDeps($o->{prefix}, $o->{method}, $o->{packages});
+ pkgs::psUpdateHdlistsDeps($o->{packages});
#- open rpm db (always without rebuilding db, it should be false at this point).
- $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix});
+ $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen();
}
}
@@ -829,7 +828,7 @@ sub setupFB {
}
sub install_urpmi {
- my ($prefix, $method, $packages, $mediums) = @_;
+ my ($method, $packages, $mediums) = @_;
#- rare case where urpmi cannot be installed (no hd install path).
$method eq 'disk' && !any::hdInstallPath() and return;
@@ -839,7 +838,7 @@ sub install_urpmi {
delete $packages->{rpmdb};
#- import pubkey in rpmdb.
- my $db = pkgs::rpmDbOpenForInstall($prefix);
+ my $db = pkgs::rpmDbOpenForInstall();
$packages->parse_pubkeys(db => $db);
foreach my $medium (values %$mediums) {
$packages->import_needed_pubkeys($medium->{pubkey}, db => $db, callback => sub {
@@ -869,7 +868,7 @@ sub install_urpmi {
#- build a list file if needed.
if ($need_list) {
my $mask = umask 077;
- open(my $LIST, ">$prefix/var/lib/urpmi/list.$name") or log::l("failed to write list.$name");
+ open(my $LIST, ">$::prefix/var/lib/urpmi/list.$name") or log::l("failed to write list.$name");
umask $mask;
#- build list file using internal data, synthesis file should exist.
@@ -884,7 +883,7 @@ sub install_urpmi {
}
} else {
#- need to use another method here to build list file.
- open(my $F, "parsehdlist '$prefix/var/lib/urpmi/hdlist.$name.cz' |");
+ open(my $F, "parsehdlist '$::prefix/var/lib/urpmi/hdlist.$name.cz' |");
local $_;
while (<$F>) {
my ($arch) = /\.([^\.]+)\.rpm$/;
@@ -898,7 +897,7 @@ sub install_urpmi {
}
#- build a names file
- if (open my $F, ">", "$prefix/var/lib/urpmi/names.$name") {
+ if (open my $F, ">", "$::prefix/var/lib/urpmi/names.$name") {
if (defined $_->{start} && defined $_->{end}) {
foreach ($_->{start} .. $_->{end}) {
print $F $packages->{depslist}[$_]->name . "\n";
@@ -908,11 +907,11 @@ sub install_urpmi {
}
#- build synthesis file if there are still not existing (ie not copied from mirror).
- if (-s "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz" <= 32) {
- unlink "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
- run_program::rooted($prefix, "parsehdlist", ">", "/var/lib/urpmi/synthesis.hdlist.$name",
+ if (-s "$::prefix/var/lib/urpmi/synthesis.hdlist.$name.cz" <= 32) {
+ unlink "$::prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
+ run_program::rooted($::prefix, "parsehdlist", ">", "/var/lib/urpmi/synthesis.hdlist.$name",
"--synthesis", "/var/lib/urpmi/hdlist.$name.cz");
- run_program::rooted($prefix, "gzip", "-S", ".cz", "/var/lib/urpmi/synthesis.hdlist.$name");
+ run_program::rooted($::prefix, "gzip", "-S", ".cz", "/var/lib/urpmi/synthesis.hdlist.$name");
}
my ($qname, $qdir) = ($name, $dir);
@@ -945,11 +944,11 @@ sub install_urpmi {
} else {
#- remove not selected media by removing hdlist and synthesis files copied.
log::l("removing media $name");
- unlink "$prefix/var/lib/urpmi/hdlist.$name.cz";
- unlink "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
+ unlink "$::prefix/var/lib/urpmi/hdlist.$name.cz";
+ unlink "$::prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
}
}
- eval { output "$prefix/etc/urpmi/urpmi.cfg", @cfg };
+ eval { output "$::prefix/etc/urpmi/urpmi.cfg", @cfg };
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 4c96011d7..12516e4da 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -289,8 +289,8 @@ sub setPackages {
my ($o, $rebuild_needed) = @_;
install_any::setPackages($o, $rebuild_needed);
- pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix});
- $rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix});
+ pkgs::selectPackagesAlreadyInstalled($o->{packages});
+ $rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages});
}
sub deselectFoundMedia {
@@ -411,7 +411,7 @@ sub pkg_install {
if ($::testing) {
log::l(qq(selecting package "$_")) foreach @l;
} else {
- $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix});
+ $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen();
pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found") foreach @l;
}
my @toInstall = pkgs::packagesToInstall($o->{packages});
@@ -426,7 +426,7 @@ sub pkg_install {
sub pkg_install_if_requires_satisfied {
my ($o, @l) = @_;
require pkgs;
- $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix});
+ $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen();
foreach (@l) {
my %newSelection;
my $pkg = pkgs::packageByName($o->{packages}, $_) || die "$_ rpm not found";
@@ -446,7 +446,7 @@ sub installPackages($$) { #- complete REWORK, TODO and TOCHECK!
if (%{$packages->{state}{ask_remove} || {}}) {
log::l("removing : ", join ', ', keys %{$packages->{state}{ask_remove}});
- pkgs::remove($o->{prefix}, [ keys %{$packages->{state}{ask_remove}} ], $packages);
+ pkgs::remove([ keys %{$packages->{state}{ask_remove}} ], $packages);
}
#- small transaction will be built based on this selection and depslist.
@@ -454,7 +454,7 @@ sub installPackages($$) { #- complete REWORK, TODO and TOCHECK!
my $time = time();
$ENV{DURING_INSTALL} = 1;
- pkgs::install($o->{prefix}, $o->{isUpgrade}, \@toInstall, $packages);
+ pkgs::install($o->{isUpgrade}, \@toInstall, $packages);
any::writeandclean_ldsoconf($o->{prefix});
delete $ENV{DURING_INSTALL};
@@ -571,7 +571,7 @@ GridHeight=70
#- and rename saved files to .mdkgiorig.
if ($o->{isUpgrade}) {
my $pkg = pkgs::packageByName($o->{packages}, 'rpm');
- $pkg && ($pkg->flag_selected || $pkg->flag_installed) && $pkg->compare(">= 4.0") and pkgs::cleanOldRpmDb($o->{prefix});
+ $pkg && ($pkg->flag_selected || $pkg->flag_installed) && $pkg->compare(">= 4.0") and pkgs::cleanOldRpmDb();
log::l("moving previous desktop files that have been updated to Trash of each user");
install_any::kdemove_desktop_file($o->{prefix});
@@ -611,11 +611,10 @@ sub install_urpmi {
my $pkg = pkgs::packageByName($o->{packages}, 'urpmi');
if ($pkg && ($pkg->flag_selected || $pkg->flag_installed)) {
- install_any::install_urpmi($o->{prefix},
- $o->{method},
+ install_any::install_urpmi($o->{method},
$o->{packages},
$o->{packages}{mediums});
- pkgs::saveCompssUsers($o->{prefix}, $o->{packages}, $o->{compssUsers});
+ pkgs::saveCompssUsers($o->{packages}, $o->{compssUsers});
}
}
@@ -657,7 +656,7 @@ sub installUpdates {
upNetwork($o);
require crypto;
- crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror}) and
+ crypto::getPackages($o->{packages}, $u->{mirror}) and
$o->pkg_install(@{$u->{packages} || []});
#- re-install urpmi with update security medium.
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index c03914f41..f939fdb29 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -296,7 +296,7 @@ sub choosePackagesTree {
},
get_info => sub {
my $p = pkgs::packageByName($packages, $_[0]) or return '';
- pkgs::extractHeaders($o->{prefix}, [$p], $packages->{mediums});
+ pkgs::extractHeaders([$p], $packages->{mediums});
my $imp = translate($pkgs::compssListDesc{$p->flag_base ? 5 : $p->rate});
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 12ae966bb..45cc0fb09 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -391,11 +391,11 @@ sub setPackages {
install_any::setPackages($o, $rebuild_needed);
$w->set(N("Looking at packages already installed..."));
- pkgs::selectPackagesAlreadyInstalled($o->{packages}, $o->{prefix});
+ pkgs::selectPackagesAlreadyInstalled($o->{packages});
if ($rebuild_needed) {
$w->set(N("Finding packages to upgrade..."));
- pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix});
+ pkgs::selectPackagesToUpgrade($o->{packages});
}
}
@@ -852,7 +852,7 @@ Do you want to install the updates?")),
eval {
if ($u->{mirror}) {
my $_w = $o->wait_message('', N("Contacting the mirror to get the list of available packages..."));
- $update_medium = crypto::getPackages($o->{prefix}, $o->{packages}, $u->{mirror});
+ $update_medium = crypto::getPackages($o->{packages}, $u->{mirror});
}
};
} while $@ || !$update_medium && $o->ask_yesorno('', N("Unable to contact mirror %s", $u->{mirror}) . ($@ ? " :\n$@" : "") . "\n\n" . N("Would you like to try again?"));
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 3312b514f..f4f2a22f7 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -50,17 +50,16 @@ sub packageMedium {
return {};
}
-sub cleanHeaders {
- my ($prefix) = @_;
- rm_rf("$prefix/tmp/headers") if -e "$prefix/tmp/headers";
+sub cleanHeaders() {
+ rm_rf("$::prefix/tmp/headers") if -e "$::prefix/tmp/headers";
}
#- get all headers from an hdlist file.
sub extractHeaders {
- my ($prefix, $pkgs, $media) = @_;
+ my ($pkgs, $media) = @_;
my %medium2pkgs;
- cleanHeaders($prefix);
+ cleanHeaders();
foreach (@$pkgs) {
foreach my $medium (values %$media) {
@@ -75,12 +74,12 @@ sub extractHeaders {
eval {
require packdrake;
my $packer = new packdrake("/tmp/$medium->{hdlist}", quiet => 1);
- $packer->extract_archive("$prefix/tmp/headers", map { $_->header_filename } @{$medium2pkgs{$_}});
+ $packer->extract_archive("$::prefix/tmp/headers", map { $_->header_filename } @{$medium2pkgs{$_}});
};
}
foreach (@$pkgs) {
- my $f = "$prefix/tmp/headers/" . $_->header_filename;
+ my $f = "$::prefix/tmp/headers/" . $_->header_filename;
$_->update_header($f) or log::l("unable to open header file $f"), next;
log::l("read header file $f");
}
@@ -357,17 +356,16 @@ sub unselectAllPackages($) {
callback_choices => \&packageCallbackChoices);
}
-sub urpmidir {
- my ($prefix) = @_;
- my $v = "$prefix/var/lib/urpmi";
+sub urpmidir() {
+ my $v = "$::prefix/var/lib/urpmi";
-l $v && !-e _ and unlink $v and mkdir $v, 0755; #- dangling symlink
-w $v ? $v : '/tmp';
}
sub psUpdateHdlistsDeps {
- my ($prefix, $_method, $packages) = @_;
+ my ($packages) = @_;
my $need_copy = 0;
- my $urpmidir = urpmidir($prefix);
+ my $urpmidir = urpmidir();
#- check if current configuration is still up-to-date and do not need to be updated.
foreach (values %{$packages->{mediums}}) {
@@ -394,7 +392,6 @@ sub psUpdateHdlistsDeps {
sub psUsingHdlists {
my ($o, $method, $o_hdlistsprefix, $o_packages, $o_initialmedium, $o_callback) = @_;
- my $prefix = $o->{prefix};
my $is_ftp = $o_hdlistsprefix =~ /^ftp:/;
my $listf = install_any::getFile($o_hdlistsprefix && !$is_ftp ? "$o_hdlistsprefix/media/media_info/hdlists" : 'media/media_info/hdlists')
or die "no hdlists found";
@@ -431,7 +428,7 @@ sub psUsingHdlists {
foreach my $h (@hdlists) {
#- make sure the first medium is always selected!
#- by default select all image.
- my $supplmedium = psUsingHdlist($prefix, $method, $o_packages, @$h);
+ my $supplmedium = psUsingHdlist($method, $o_packages, @$h);
$o_callback and $o_callback->($supplmedium, $o_hdlistsprefix, $method);
}
@@ -442,9 +439,9 @@ sub psUsingHdlists {
}
sub psUsingHdlist {
- my ($prefix, $method, $packages, $hdlist, $medium_name, $rpmsdir, $descr, $selected, $o_fhdlist, $o_pubkey, $o_nocopy) = @_;
+ my ($method, $packages, $hdlist, $medium_name, $rpmsdir, $descr, $selected, $o_fhdlist, $o_pubkey, $o_nocopy) = @_;
my $fakemedium = "$descr ($method$medium_name)";
- my $urpmidir = urpmidir($prefix);
+ my $urpmidir = urpmidir();
log::l("trying to read $hdlist for medium $medium_name");
my $m = { hdlist => $hdlist,
@@ -637,7 +634,7 @@ sub readCompssUsers {
}
sub saveCompssUsers {
- my ($prefix, $packages, $compssUsers) = @_;
+ my ($packages, $compssUsers) = @_;
my $flat;
foreach (@$compssUsers) {
my %fl = map { $_ => 1 } @{$_->{flags}};
@@ -649,7 +646,7 @@ sub saveCompssUsers {
}
}
}
- my $urpmidir = urpmidir($prefix);
+ my $urpmidir = urpmidir();
output "$urpmidir/compssUsers.flat", $flat;
}
@@ -819,10 +816,9 @@ sub computeGroupSize {
}
-sub openInstallLog {
- my ($prefix) = @_;
+sub openInstallLog() {
- my $f = "$prefix/root/drakx/install.log";
+ my $f = "$::prefix/root/drakx/install.log";
open(my $LOG, ">> $f") ? log::l("opened $f") : log::l("Failed to open $f. No install log will be kept."); #-#
CORE::select((CORE::select($LOG), $| = 1)[0]);
c::rpmErrorSetCallback(fileno $LOG);
@@ -831,7 +827,7 @@ sub openInstallLog {
}
sub rpmDbOpen {
- my ($prefix, $o_rebuild_needed) = @_;
+ my ($o_rebuild_needed) = @_;
if ($o_rebuild_needed) {
if (my $pid = fork()) {
@@ -839,17 +835,17 @@ sub rpmDbOpen {
$? & 0xff00 and die "rebuilding of rpm database failed";
} else {
log::l("rebuilding rpm database");
- my $rebuilddb_dir = "$prefix/var/lib/rpmrebuilddb.$$";
+ my $rebuilddb_dir = "$::prefix/var/lib/rpmrebuilddb.$$";
-d $rebuilddb_dir and log::l("removing stale directory $rebuilddb_dir"), rm_rf($rebuilddb_dir);
- URPM::DB::rebuild($prefix) or log::l("rebuilding of rpm database failed: " . c::rpmErrorString()), c::_exit(2);
+ URPM::DB::rebuild($::prefix) or log::l("rebuilding of rpm database failed: " . c::rpmErrorString()), c::_exit(2);
c::_exit(0);
}
}
my $db;
- if ($db = URPM::DB::open($prefix)) {
+ if ($db = URPM::DB::open($::prefix)) {
log::l("opened rpm database for examining existing packages");
} else {
log::l("unable to open rpm database, using empty rpm db emulation");
@@ -859,31 +855,29 @@ sub rpmDbOpen {
$db;
}
-sub rpmDbOpenForInstall {
- my ($prefix) = @_;
+sub rpmDbOpenForInstall() {
#- there is a bug in rpm 4.2 where all operations for accessing rpmdb files are not
#- always done using prefix, we need to setup a symlink in /var/lib/rpm for that ...
unless (-e "/var/lib/rpm") {
#- check if at some time a /var/lib directory has been made.
if (-d "/var/lib") {
- symlinkf "$prefix/var/lib/rpm", "/var/lib/rpm";
+ symlinkf "$::prefix/var/lib/rpm", "/var/lib/rpm";
} else {
- symlinkf "$prefix/var/lib", "/var/lib";
+ symlinkf "$::prefix/var/lib", "/var/lib";
}
}
- my $db = URPM::DB::open($prefix, 1);
- $db and log::l("opened rpmdb for writing in $prefix");
+ my $db = URPM::DB::open($::prefix, 1);
+ $db and log::l("opened rpmdb for writing in $::prefix");
$db;
}
-sub cleanOldRpmDb {
- my ($prefix) = @_;
+sub cleanOldRpmDb() {
my $failed;
foreach (qw(Basenames Conflictname Group Name Packages Providename Requirename Triggername)) {
- -s "$prefix/var/lib/rpm/$_" or $failed = 'failed';
+ -s "$::prefix/var/lib/rpm/$_" or $failed = 'failed';
}
#- rebuilding has been successfull, so remove old rpm database if any.
#- once we have checked the rpm4 db file are present and not null, in case
@@ -892,22 +886,22 @@ sub cleanOldRpmDb {
log::l("rebuilding rpm database completed successfully");
foreach (qw(conflictsindex.rpm fileindex.rpm groupindex.rpm nameindex.rpm packages.rpm
providesindex.rpm requiredby.rpm triggerindex.rpm)) {
- -e "$prefix/var/lib/rpm/$_" or next;
+ -e "$::prefix/var/lib/rpm/$_" or next;
log::l("removing old rpm file $_");
- rm_rf("$prefix/var/lib/rpm/$_");
+ rm_rf("$::prefix/var/lib/rpm/$_");
}
}
}
sub selectPackagesAlreadyInstalled {
- my ($packages, $_prefix) = @_;
+ my ($packages) = @_;
log::l("computing installed flags and size of installed packages");
$packages->{sizes} = $packages->compute_installed_flags($packages->{rpmdb});
}
sub selectPackagesToUpgrade {
- my ($packages, $_prefix, $o_medium) = @_;
+ my ($packages, $o_medium) = @_;
#- check before that if medium is given, it should be valid.
$o_medium && (! defined $o_medium->{start} || ! defined $o_medium->{end}) and return;
@@ -1024,8 +1018,8 @@ sub installCallback {
# log::l($msg .": ". join(',', @_));
}
-sub install($$$;$$) {
- my ($prefix, $isUpgrade, $toInstall, $packages) = @_;
+sub install {
+ my ($isUpgrade, $toInstall, $packages) = @_;
my %packages;
delete $packages->{rpmdb}; #- make sure rpmdb is closed before.
@@ -1045,11 +1039,11 @@ sub install($$$;$$) {
$total += to_int($pkg->size); #- do not correct for upgrade!
}
- log::l("pkgs::install $prefix");
+ log::l("pkgs::install $::prefix");
log::l("pkgs::install the following: ", join(" ", map { $_->name } values %packages));
URPM::read_config_files();
- my $LOG = openInstallLog($prefix);
+ my $LOG = openInstallLog();
#- do not modify/translate the message used with installCallback since
#- these are keys during progressing installation, or change in other
@@ -1062,14 +1056,14 @@ sub install($$$;$$) {
#- added to exit typically after last media unselected.
if ($nb == 0 && scalar(@transToInstall) == 0) {
- cleanHeaders($prefix);
+ cleanHeaders();
loopback::save_boot($loop_boot);
return;
}
#- extract headers for parent as they are used by callback.
- extractHeaders($prefix, \@transToInstall, $packages->{mediums});
+ extractHeaders(\@transToInstall, $packages->{mediums});
my ($retry_pkg, $retry_count);
while ($retry_pkg || @transToInstall) {
@@ -1120,8 +1114,8 @@ sub install($$$;$$) {
print OUTPUT "inst:$id:start:0:$size_typical\ninst:$id:progress:0:$size_typical\nclose:$id\n";
}
} else { eval {
- my $db = rpmDbOpenForInstall($prefix) or die "error opening RPM database: ", c::rpmErrorString();
- my $trans = $db->create_transaction($prefix);
+ my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", c::rpmErrorString();
+ my $trans = $db->create_transaction($::prefix);
if ($retry_pkg) {
log::l("opened rpm database for retry transaction of 1 package only");
$trans->add($retry_pkg, $isUpgrade && allowedToUpgrade($retry_pkg->name))
@@ -1239,27 +1233,27 @@ sub install($$$;$$) {
}
}
}
- cleanHeaders($prefix);
+ cleanHeaders();
} while $nb > 0 && !$pkgs::cancel_install;
log::l("closing install.log file");
close $LOG;
eval { fs::umount("/mnt/cdrom") };
- cleanHeaders($prefix);
+ cleanHeaders();
loopback::save_boot($loop_boot);
}
sub remove {
- my ($prefix, $toRemove, $packages) = @_;
+ my ($toRemove, $packages) = @_;
delete $packages->{rpmdb}; #- make sure rpmdb is closed before.
return if !@{$toRemove || []};
- my $db = rpmDbOpenForInstall($prefix) or die "error opening RPM database: ", c::rpmErrorString();
- my $trans = $db->create_transaction($prefix);
+ my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", c::rpmErrorString();
+ my $trans = $db->create_transaction($::prefix);
foreach my $p (@$toRemove) {
#- stuff remove all packages that matches $p, not a problem since $p has name-version-release format.