Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH ExtUtils::MM_Unix] naughty behavior in parse_file() #206

Closed
p5pRT opened this issue Jul 18, 1999 · 1 comment
Closed

[PATCH ExtUtils::MM_Unix] naughty behavior in parse_file() #206

p5pRT opened this issue Jul 18, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Jul 18, 1999

Migrated from rt.perl.org#1012 (status was 'resolved')

Searchable as RT1012$

@p5pRT
Copy link
Author

p5pRT commented Jul 18, 1999

From @schwern

Package namespace installed latest in CPAN file
AutoLoader undef 5.56 CHIPS/perl5.004_05.tar.gz
Could not eval '
  package ExtUtils​::MakeMaker​::_version;
  no strict;

  local $VERSION;
  $VERSION=undef; do {
  $VERSION = _version();
  }; $VERSION
  ' in /home/schwern/lib/perl5/site_perl/5.005/Bio/Index/EMBL.pm​: Undefined subroutine &ExtUtils​::MakeMaker​::_version​::_version called at (eval 234) line 7, <FH> chunk 103.

Lovely, ain't it?

The failure comes because Bio​::Index​::EMBL does the following​:

sub _version {
  return 0.1;
}
$VERSION = _version();

And parse_version() only sees "$VERSION = _version();". As
Bio​::Index​::EMBL​::_version hasn't been loaded, the eval fails. Now, I
have no idea how to improve parse_version to fix this, but I -do- know
that it shouldn't -die- upon failing to eval.

I've switched the eval to a warning and added a smidge more
documentation to parse_version. I've also mentioned this to the
bioperl developers and recommended they alter the way they set $VERSION
so that parse_version can see it.

*** lib/ExtUtils/MM_Unix.pm 1999/07/19 01​:37​:56
--- lib/ExtUtils/MM_Unix.pm 1999/07/19 01​:56​:40
***************
*** 2564,2570 ****
 
  =item parse_version
 
! parse a file and return what you think is $VERSION in this file set to
 
  =cut
 
--- 2564,2571 ----
 
  =item parse_version
 
! parse a file and return what you think is $VERSION in this file set to.
! It will return undef if it can't figure out what $VERSION is.
 
  =cut
 
***************
*** 2592,2598 ****
  };
  local($^W) = 0;
  $result = eval($eval);
! die "Could not eval '$eval' in $parsefile​: $@​" if $@​;
  $result = "undef" unless defined $result;
  last;
  }
--- 2593,2599 ----
  };
  local($^W) = 0;
  $result = eval($eval);
! warn "Could not eval '$eval' in $parsefile​: $@​" if $@​;
  $result = "undef" unless defined $result;
  last;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant