From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: at@turbinal.org Date: Wed, 16 Oct 2002 08:44:30 +0400 To: devel@altlinux.ru Subject: Re: [devel] perl-5.8.0-alt0.3 (important) Message-ID: <20021016044430.GA19475@homestead.turbinal.org> Mail-Followup-To: devel@altlinux.ru References: <20021016014557.GA29249@homestead.turbinal.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20021016014557.GA29249@homestead.turbinal.org> Sender: devel-admin@altlinux.ru Errors-To: devel-admin@altlinux.ru X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: devel@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: List-Post: --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Oct 16, 2002 at 05:45:57AM +0400, at@turbinal.org wrote: > > В incoming заливается perl-5.8.0-alt0.3.nosrc.rpm. Залилось. :) > относительно perl. Для этого я написал скрипт, который можно также > использовать для анализа перловых зависимостей других пакетов. Скрипт > прилагается (но он ни на что не претендует; желающие должны его > доработать и обязательно об этом сообщить). В результате удалось Доработал. --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="depend.pl" #!/usr/bin/perl # # check whether perl part of the package depends on perl-base only # use strict; sub whatsays($) { my $command = shift; local $_ = `$command`; $? and print qq(warning: $command\n\texecuted with $? status\n); my @parts = split; return wantarray ? @parts : $parts[0]; } my %cache; my $n_call = 0; sub whatprovides(@) { my $prov = shift; if ($cache{$prov}) { $n_call++; } else { my @pkgs = whatsays qq(rpm -q --whatprovides '$prov'); $cache{$prov} = \@pkgs; print "warning: $prov is provided by " . join(' AND ' => @pkgs) . "\n" if @pkgs > 1; } return @{$cache{$prov}}; } my @packages = @ARGV; my $base = whatsays qq(rpm -q 'perl-base'); foreach my $package (@packages) { $package = whatsays qq(rpm -q '$package'); my @files = whatsays qq(rpm -ql '$package' '$base' | sort | uniq); my $n = @files; print "checking whether perl part of $package package ($n files)\n\tdepends on $base only\n"; foreach my $file (@files) { my @req = map { /perl\(.+?\)/ ? $& :() } whatsays qq(/usr/lib/rpm/perl.req '$file'); foreach my $req (@req) { my @prov = whatprovides $req; print "file $file requires\n\t$req provided by @prov\n" unless grep { "@prov" =~ /\Q$_/ } ($base, $package); } } } print "whatprovides: " . keys(%cache) . " entries cached ($n_call fork+exec calls saved)\n"; --3V7upXqbjpZ4EhLz--