From c15afb4a54dd6003ed89efaf6d42ef2db7eb887f Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 22 May 2000 20:57:51 +0000 Subject: *** empty log message *** --- perl-install/Makefile | 3 +++ perl-install/c/stuff.xs.pm | 7 +++++++ perl-install/common.pm | 8 +++----- perl-install/install_steps_gtk.pm | 11 +++-------- perl-install/modules.pm | 2 +- perl-install/pkgs.pm | 18 +++++++++++++----- perl-install/share/list.sparc | 1 + 7 files changed, 31 insertions(+), 19 deletions(-) (limited to 'perl-install') 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 <[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 -- cgit v1.2.1