summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-05-22 20:57:51 +0000
committerFrancois Pons <fpons@mandriva.com>2000-05-22 20:57:51 +0000
commitc15afb4a54dd6003ed89efaf6d42ef2db7eb887f (patch)
treec56ca90952b5e6499f897d11f73657d7cfc7a55c /perl-install
parent58d2d2741ce5d150377e92b36d3ea5aaec97eb90 (diff)
downloaddrakx-backup-do-not-use-c15afb4a54dd6003ed89efaf6d42ef2db7eb887f.tar
drakx-backup-do-not-use-c15afb4a54dd6003ed89efaf6d42ef2db7eb887f.tar.gz
drakx-backup-do-not-use-c15afb4a54dd6003ed89efaf6d42ef2db7eb887f.tar.bz2
drakx-backup-do-not-use-c15afb4a54dd6003ed89efaf6d42ef2db7eb887f.tar.xz
drakx-backup-do-not-use-c15afb4a54dd6003ed89efaf6d42ef2db7eb887f.zip
*** empty log message ***
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile3
-rw-r--r--perl-install/c/stuff.xs.pm7
-rw-r--r--perl-install/common.pm8
-rw-r--r--perl-install/install_steps_gtk.pm11
-rw-r--r--perl-install/modules.pm2
-rw-r--r--perl-install/pkgs.pm18
-rw-r--r--perl-install/share/list.sparc1
7 files changed, 31 insertions, 19 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 7e4ebb940..3265325ce 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -125,6 +125,9 @@ endif
if [ -f ../modules/modules.cz* ]; then \
cp -f ../modules/modules.cz* $(DEST)/lib/; \
+ if [ -f ../modules64/modules.cz* ]; then \
+ cp -f ../modules64/modules.cz* $(DEST)/lib/modules64.cz2; \
+ fi \
else \
cp -f ../modules/modules.cpio.bz2 $(DEST)/lib/; \
install -d $(DEST)/lib/modules; \
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm
index 6296c7461..77c779c83 100644
--- a/perl-install/c/stuff.xs.pm
+++ b/perl-install/c/stuff.xs.pm
@@ -261,6 +261,13 @@ kernel_version()
OUTPUT:
RETVAL
+char *
+kernel_arch()
+ CODE:
+ struct utsname u;
+ if (uname(&u) == 0) RETVAL = u.machine; else RETVAL = NULL;
+ OUTPUT:
+ RETVAL
int
set_loop(dev_fd, file)
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 643201b3e..0a9a29271 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -136,14 +136,12 @@ sub expand_symlinks {
}
sub arch() {
- require Config;
- Config->import;
- no strict;
- $Config{archname} =~ /(.*)-/ and $1;
+ require c;
+ c::kernel_arch();
}
sub better_arch {
my ($new, $old) = @_;
- while ($new && $new != $old) { $new = $compat_arch{$_} }
+ while ($new && $new ne $old) { $new = $compat_arch{$new} }
$new;
}
sub compat_arch { better_arch(arch(), $_[0]) }
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index c8e1b8859..763012057 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -83,6 +83,7 @@ sub new($$) {
} elsif (arch() =~ /^sparc/) {
local $_ = cat_("/proc/fb");
if (/Mach64/) { @servers = qw(Mach64) }
+ elsif (/Permedia2/) { @servers = qw(3DLabs) }
else { @servers = qw(Xsun24) }
}
@servers = qw(PPCDummy) if arch() eq "ppc";
@@ -946,9 +947,6 @@ Section "Screen"
EndSubsection
EndSection
-END
- if (arch() =~ /^sparc/) {
- print F <<END_FBDEV_SPARC;
Section "Screen"
Driver "svga"
Device "svga"
@@ -959,9 +957,7 @@ Section "Screen"
ViewPort 0 0
EndSubsection
EndSection
-END_FBDEV_SPARC
- } else {
- print F <<END_FBDEV;
+
Section "Screen"
Driver "accel"
Device "svga"
@@ -972,8 +968,7 @@ Section "Screen"
ViewPort 0 0
EndSubsection
EndSection
-END_FBDEV
- }
+END
}
#- ModeLine "640x480" 28 640 672 768 800 480 490 492 525
#-######################################################################################
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 198bc118f..d4e2bcddd 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -423,7 +423,7 @@ sub unload($;$) {
sub load_raw {
my @l = map { my ($i, @i) = @$_; [ $i, \@i ] } @_;
- my $cz = "/lib/modules.cz"; -e $cz or $cz .= "2";
+ my $cz = "/lib/modules" . (arch() eq 'sparc64' && "64") . ".cz"; -e $cz or $cz .= "2";
run_program::run("extract_archive", $cz, "/tmp", map { "$_->[0].o" } @l);
my @failed = grep {
my $m = "/tmp/$_->[0].o";
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 8db9231a9..36647a872 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -115,7 +115,7 @@ my %ignoreBadPkg = (
#- simpler and faster depslist reader, this gets (sizeDeps).
sub packageHeaderFile { my ($pkg) = @_; $pkg->{file} }
sub packageName { my ($pkg) = @_; $pkg->{file} =~ /([^\(]*)(?:\([^\)]*\))?-[^-]+-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
-sub packageSpecificArch { my ($pkg) = @_; $pkg->{file} =~ /[^\(]*(?:\(([^\)])*\))?-[^-]+-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
+sub packageSpecificArch { my ($pkg) = @_; $pkg->{file} =~ /[^\(]*(?:\(([^\)]*)\))?-[^-]+-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
sub packageVersion { my ($pkg) = @_; $pkg->{file} =~ /.*-([^-]+)-[^-]+/ ? $1 : die "invalid file `$pkg->{file}'" }
sub packageRelease { my ($pkg) = @_; $pkg->{file} =~ /.*-[^-]+-([^-]+)/ ? $1 : die "invalid file `$pkg->{file}'" }
@@ -181,11 +181,19 @@ sub extractHeaders($$$) {
}
#- size and correction size functions for packages.
+#- invCorrectSize corrects size in the range 0 to 3Gb approximately, so
+#- it should not be used outside these levels.
+#- but since it is an inverted parabolic curve starting above 0, we can
+#- get a solution where X=Y at approximately 9.3Gb. we use this point as
+#- a limit to change the approximation to use a linear one.
+#- for information above this point, we have the corrected size below the
+#- original size wich is absurd, this point is named D below.
my $A = -1.922e-05;
my $B = 1.18411;
my $C = 23.2; #- doesn't take hdlist's into account as getAvailableSpace will do it.
-sub correctSize { max($_[0], ($A * $_[0] + $B) * $_[0] + $C) } #- size correction in MB.
-sub invCorrectSize { min($_[0], (sqrt(max(sqr($B) + 4 * $A * ($_[0] - $C), 0)) - $B) / 2 / $A) } #- size correction in MB.
+my $D = (sqrt(sqr($B - 1) - 4 * $A * $C) - ($B - 1)) / 2 / $A;
+sub correctSize { $_[0] < $D ? ($A * $_[0] + $B) * $_[0] + $C : $_[0] } #- size correction in MB.
+sub invCorrectSize { $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0]; } #- size correction in MB.
sub selectedSize {
my ($packages) = @_;
@@ -426,7 +434,7 @@ sub psUsingHdlist {
if ($old_pkg) {
if (packageVersion($pkg) eq packageVersion($old_pkg) && packageRelease($pkg) eq packageRelease($old_pkg)) {
if (better_arch($specific_arch, packageSpecificArch($old_pkg))) {
- log::l("replacing old package with package $1 with better arch");
+ log::l("replacing old package with package $1 with better arch: $specific_arch");
$packages->[0]{packageName($pkg)} = $pkg;
} else {
log::l("keeping old package against package $1 with worse arch");
@@ -438,7 +446,7 @@ sub psUsingHdlist {
$packages->[0]{packageName($pkg)} = $pkg;
}
} else {
- log::l("ignoring package $1 with incompatible arch");
+ log::l("ignoring package $1 with incompatible arch: $specific_arch");
}
} else {
die "bad hdlist file: $newf";
diff --git a/perl-install/share/list.sparc b/perl-install/share/list.sparc
index efe38ea7a..dca2dd4a9 100644
--- a/perl-install/share/list.sparc
+++ b/perl-install/share/list.sparc
@@ -78,4 +78,5 @@
/usr/lib/rpm/rpmrc
/usr/X11R6/bin/Xsun24
/usr/X11R6/bin/XF86_Mach64
+/usr/X11R6/bin/XF86_3DLabs
/usr/X11R6/bin/xmodmap