SVN: toys/rsget.pl/RSGet/Get.pm

sparky sparky at pld-linux.org
Fri Jul 16 15:24:05 CEST 2010


Author: sparky
Date: Fri Jul 16 15:24:04 2010
New Revision: 11677

Modified:
   toys/rsget.pl/RSGet/Get.pm
Log:
- simplified info() and bestinfo()


Modified: toys/rsget.pl/RSGet/Get.pm
==============================================================================
--- toys/rsget.pl/RSGet/Get.pm	(original)
+++ toys/rsget.pl/RSGet/Get.pm	Fri Jul 16 15:24:04 2010
@@ -380,11 +380,8 @@
 {
 	my $self = shift;
 	my $o = $self->{_opts};
-	my $i = $self->{info};
 
 	my $bestname = $o->{fname}
-		|| $i->{name} || $i->{iname}
-		|| $i->{aname} || $i->{ainame}
 		|| $o->{name} || $o->{iname}
 		|| $o->{aname} || $o->{ainame};
 	unless ( $bestname ) {
@@ -396,7 +393,6 @@
 	$self->{_name} = $bestname;
 
 	my $bestsize = $o->{fsize}
-		|| $i->{size} || $i->{asize}
 		|| $o->{size} || $o->{asize}
 		|| "?";
 	$self->{bestsize} = $bestsize;
@@ -406,10 +402,10 @@
 {
 	my $self = shift;
 	my %info = @_;
-	$info{asize} =~ s/ //g if $info{asize};
+	$info{asize} =~ s/\s+//g if $info{asize};
 	RSGet::FileList::save( $self->{_uri}, options => \%info );
 
-	$self->{info} = \%info;
+	@{$self->{_opts}->{ keys %info }} = values %info;
 	$self->bestinfo();
 
 	return 0 unless $self->{_cmd} eq "check";


More information about the pld-cvs-commit mailing list