Skip to content

Commit

Permalink
file filter, eval{version}
Browse files Browse the repository at this point in the history
  • Loading branch information
Masahiro Nagano committed Feb 4, 2011
1 parent 9d26931 commit 49fc08d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/OrePAN/Archive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ sub get_packages {
for my $file (@files) {
my $quote = quotemeta($archive);
next if any { $file =~ m{^$quote/$_/} } @ignore_dirs;
next if $file !~ /(?:\.pm|(?:\.|_)pm\.PL)$/; #for common::sense, XSLoader
next if $file !~ /\.pm(?:\.PL)?$/; #for common::sense
infof("parsing: $file");
my $module = Module::Metadata->new_from_file( $file );
my $pkg = $module->name;
Expand Down
8 changes: 7 additions & 1 deletion lib/OrePAN/Package/Index.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ sub add {
my ($self, $path, $data) = @_;
my $dist = CPAN::DistnameInfo->new($path);
if ( $self->{data}->{$dist->dist} ) {
if ( version->parse($dist->version) <= version->parse($self->{data}->{$dist->dist}->{version}) ) {
my $p_version;
my $n_version;
eval {
$p_version = version->parse($self->{data}->{$dist->dist}->{version});
$n_version = version->parse($dist->version);
};
if ( !$@ && $n_version <= $p_version ) {
infof( "SKIP: already has newer version %s-%s: adding %s", $dist->dist, $self->{data}->{$dist->dist}->{version},
$dist->version);
return;
Expand Down

0 comments on commit 49fc08d

Please sign in to comment.