Files
alien/Alien/Package/.Rpm.pm.swp

25 lines
16 KiB
Plaintext
Raw Normal View History

b0VIM 7.2I<><49>J<EFBFBD>Ne joeygnu~joey/src/alien/Alien/Package/Rpm.pm 3210#"! U
<00>
r
"

<00> <00> <00> <00> <00> <00> <00> w t s X  <00><00><00><00><00>KJ5<00><00><00>qnmH%<00><00><00>WVH.<00><00><00><00><00><00>gd&<00><00><00><00><00><00><00><00><00><00><00>A<00><00><00><00><00><00><00><00><00><00><00><00> or die "Unpacking of '".$this->filename."' failed"; $this->do("rpm2cpio ".$this->filename." | (cd $workdir; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>&1") my $workdir=$this->unpacked_tree; $this->SUPER::unpack(@_); my $this=shift;sub unpack {=cutpermissions fixing as well.because it has to handle relocatable rpms and has to do a bit ofImplement the unpack method to unpack a rpm file. This is a little nasty=item unpack} return 1; $this->origformat("rpm"); $this->distribution("Red Hat"); } die "Error querying rpm file"; ! defined $this->name) { if (! defined $this->release || ! defined $this->version || } $this->description($this->summary); unless (defined $this->description) { } $this->copyright('unknown'); unless (defined $this->copyright) { } } $this->summary('Converted RPM package'); if (! $this->summary) { # Fallback. $this->summary($this->description."\n")=~m/(.*?)\n/m; # description, and use it for the summary. # description. We'll take the 1st line out of the # Older rpms will have no summary, but will have a unless (defined $this->summary) { # Sanity check and sanitize fields. } $this->filelist([]); $this->filelist->[0] eq '(contains no files)') { if (defined $this->filelist->[0] && $this->filelist([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qpl $file")]); # Get the filelist. $this->binary_info(scalar $this->runpipe(0, "rpm -qpi $file")); } $this->conffiles([]); $this->conffiles->[0] eq '(contains no files)') { if (defined $this->conffiles->[0] && $this->conffiles([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qcp $file")]); # Get the conffiles list. } $this->$key($value); $value='' if $value eq '(none)'; } $key=lc($field); else { } $key=$fieldtrans{$field}; if (exists $fieldtrans{$field}) { my $key; my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file"); keys(%fieldtrans)) { SUMMARY DESCRIPTION COPYRIGHT PREFIXES}, foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT # Use --queryformat to pull out all the fields we need. ); POSTUN => 'postrm', PREUN => 'prerm', POSTIN => 'postinst', PREIN => 'preinst', my %fieldtrans=( my $file=$this->filename; $this->SUPER::scan(@_); my $this=shift;sub scan {=cutImplement the scan method to read a rpm file.=item scan} $Alien::Package::verbose=$v; or die "Unable to install"; $this->do("rpm -ivh ".(exists $ENV{RPMINSTALLOPT} ? $ENV{RPMINSTALLOPT} : '').$rpm) $Alien::Package::verbose=2; my $v=$Alien::Package::verbose; my $rpm=shift; my $this=shift;sub install {=cutit are passed to rpm on its command line.Install a rpm. If RPMINSTALLOPT is set in the environement, the options in=item install} return $file =~ m/.*\.rpm$/; my $file=shift; my $this=shift;sub checkfile {=cutDetect rpm files by their extention.=item checkfile=over 4=head1 METHODS=backRelocatable rpm packages have a prefixes field.=item prefixes=over 4=head1 FIELDSAlien::Package.This is an object class that represents a rpm package. It is derived from=head1 DESCRIPTIONuse base qw(Alien::Package);use strict;package Alien::Package::Rpm;=cutAlien::Package::Rpm - an object that represents a rpm package=head1 NAME#!/usr/bin/perl -wad/<00> d<00><00><00><00><00><00><00>pn`O(& <00><00><00><00><00><00>I<00> <00> <00> <00> <00> <00> <00> <00> <00> <00> } k g P > : #   <00> <00> <00> <00> <00> <00> <00> y u X F B <00> <00> <00> <00> <00> <00> <00> j Y U R ; 8 7 !  <00>
<00>
<00>
<00>
<00>
<00>
<00>
e
S
P
6
$
!




<00> <00> <00> <00> <00> <00> <00> <00> 1=cutJoey Hess <joey@kitenet.net>=head1 AUTHOR=back} return $arch } $arch='noarch'; elsif ($arch eq 'all') { } $arch='parisc'; elsif ($arch eq 'hppa') { } $arch='ppc'; # systems? # XXX is this the canonical name for powerpc on rpm elsif ($arch eq 'powerpc') { } $arch='x86_64'; if ($arch eq 'amd64') { $arch=$this->{arch}; } $this->{arch}=$arch; } $arch='hppa'; elsif ($arch eq 'parisc') { } $arch='arm'; # Treat armv4l as arm. elsif ($arch eq 'armv4l') { } $arch='i386'; # Treat 486, 586, etc, as 386. elsif ($arch =~ m/i\d86/i || $arch =~ m/pentium/i) { } $arch='amd64'; elsif ($arch eq 'em64t') { } $arch='amd64'; elsif ($arch eq 'x86_64') { } $arch='powerpc'; elsif ($arch eq 'ppc') { } $arch='all'; elsif ($arch eq 'noarch') { } $arch='m68k'; elsif ($arch eq 6) { } $arch='sparc'; elsif ($arch eq 3) { } $arch='alpha'; elsif ($arch eq 2) { } $arch='i386'; if ($arch eq 1) { $arch=shift; if (@_) { my $arch; my $this=shift;sub arch {=cutretreived it's converted back to rpm form from the internal form.first to convert it to the debian format used internally. When it'sSet/get arch field. When the arch field is set, some sanitizing is done=item arch} $this->_script_helper('prerm', @_); my $this=shift;sub prerm {} $this->_script_helper('preinst', @_); my $this=shift;sub preinst {} $this->_script_helper('postrm', @_); my $this=shift;sub postrm {} $this->_script_helper('postinst', @_); my $this=shift;sub postinst {}