diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/bootloader.pm | 6 | ||||
-rw-r--r-- | perl-install/c/stuff.xs.pl | 26 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 13 |
3 files changed, 9 insertions, 36 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 505508fc0..4468e814c 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -18,7 +18,7 @@ use detect_devices; use partition_table::raw; use run_program; use modules; - +use URPM; #-##################################################################################### #- Functions @@ -481,7 +481,7 @@ sub add_kernel { #- normalize append and handle special options { my ($simple, $dict) = unpack_append("$bootloader->{perImageAppend} $v->{append}"); - if (-e "$::prefix/sbin/udev" && $kernel_str->{version} =~ /(2\.\d+\.\d+)/ && c::rpmvercmp($1, '2.6.8') >= 0) { + if (-e "$::prefix/sbin/udev" && $kernel_str->{version} =~ /(2\.\d+\.\d+)/ && URPM::rpmvercmp($1, '2.6.8') >= 0) { log::l("it is a recent kernel, so we remove any existing devfs= kernel option to enable udev"); @$dict = grep { $_->[0] ne 'devfs' } @$dict; } @@ -661,7 +661,7 @@ sub get_kernel_labels { my ($kernels, $b_prefer_24) = @_; my @kernels_str = - sort { c::rpmvercmp($b->{version_no_ext}, $a->{version_no_ext}) } + sort { URPM::rpmvercmp($b->{version_no_ext}, $a->{version_no_ext}) } grep { -d "$::prefix/lib/modules/$_->{version}" } map { vmlinuz2kernel_str($_) } @$kernels; diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 88ee2c5a1..77d5f586f 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -81,17 +81,6 @@ print ' #undef Fflush #undef Mkdir #undef Stat -#include <rpm/rpmlib.h> -#include <rpm/rpmio.h> - -void rpmError_callback_empty(void) {} - -int rpmError_callback_data; -void rpmError_callback(void) { - if (rpmErrorCode() != RPMERR_UNLINK && rpmErrorCode() != RPMERR_RMDIR) { - write(rpmError_callback_data, rpmErrorString(), strlen(rpmErrorString())); - } -} '; @@ -756,21 +745,6 @@ get_iso_volume_ids(int fd) '; -print ' -const char * -rpmErrorString() - -void -rpmErrorSetCallback(fd) - int fd - CODE: - rpmError_callback_data = fd; - rpmErrorSetCallback(rpmError_callback); - -int -rpmvercmp(char *a, char *b); -'; - @macros = ( [ qw(int S_IFCHR S_IFBLK S_IFIFO KDSKBENT KT_SPEC K_NOSUCHMAP NR_KEYS MAX_NR_KEYMAPS BLKRRPART TIOCSCTTY HDIO_GETGEO BLKGETSIZE LOOP_GET_STATUS diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index af8cbb4f3..7868ecd73 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -844,11 +844,10 @@ sub computeGroupSize { sub openInstallLog() { - 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); + URPM::rpmErrorSetCallback(fileno $LOG); $LOG; } @@ -864,7 +863,7 @@ sub rpmDbOpen { 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: " . URPM::rpmErrorString()), c::_exit(2); c::_exit(0); } @@ -1133,7 +1132,7 @@ sub install { print OUTPUT "inst:$id:start:0:$size_typical\ninst:$id:progress:0:$size_typical\nclose:$id\n"; } } else { eval { - my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", c::rpmErrorString(); + my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", URPM::rpmErrorString(); my $trans = $db->create_transaction($::prefix); if ($retry_pkg) { log::l("opened rpm database for retry transaction of 1 package only"); @@ -1147,7 +1146,7 @@ sub install { } my @checks = $trans->check; @checks and log::l("check failed : " . join("\n ", @checks)); - $trans->order or die "error ordering package list: " . c::rpmErrorString(); + $trans->order or die "error ordering package list: " . URPM::rpmErrorString(); $trans->set_script_fd(fileno $LOG); log::l("rpm transactions start"); @@ -1172,7 +1171,7 @@ sub install { my ($p) = @_; $check_installed ||= $pkg->compare_pkg($p) == 0; }); - $check_installed or log::l($pkg->name . " not installed, " . c::rpmErrorString()); + $check_installed or log::l($pkg->name . " not installed, " . URPM::rpmErrorString()); $check_installed and print OUTPUT "close:$id\n"; }, callback_inst => sub { my ($_data, $type, $id, $subtype, $amount, $total) = @_; @@ -1271,7 +1270,7 @@ sub remove { return if !@{$toRemove || []}; - my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", c::rpmErrorString(); + my $db = rpmDbOpenForInstall() or die "error opening RPM database: ", URPM::rpmErrorString(); my $trans = $db->create_transaction($::prefix); foreach my $p (@$toRemove) { |