[Slapt-get-user] Exception handling fix for cpan2tgz
David Unric
dunric29a at gmail.com
Sun Jan 4 10:09:06 EST 2009
Hello,
I've just figured out latest update (ver. 0.6.4) fixing problems with
improper return value of make function of CPAN module fails to work in
localized environments, because error messages are also localized. It would
be hence more appropriate to do check against error number which is
independent on environment settings.
My suggested fix:
--- /usr/bin/cpan2tgz.orig 2009-01-01 17:02:23.000000000 +0100
+++ /usr/bin/cpan2tgz 2009-01-04 14:21:26.000000000 +0100
@@ -29,6 +29,7 @@
use CPAN;
use Getopt::Long;
use File::Find ();
+use Errno;
our $VERSION = '0.6.4';
our $HAS_YAML = 1;
@@ -158,7 +159,7 @@
# make does not return the same when YAML or YAML::Syck is in
# use and $! is set to an internal non-fatal value from a YAML
# check
- if (!($! eq 'Inappropriate ioctl for device' && $HAS_YAML)) {
+ if (!($!{ENOTTY} && $HAS_YAML)) {
print "make ERROR [$module_name]: $!\n";
exit(1);
}
Take care,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.jaos.org/pipermail/slapt-get-user/attachments/20090104/e3094326/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpan2tgz.patch.gz
Type: application/x-gzip
Size: 414 bytes
Desc: not available
URL: <http://software.jaos.org/pipermail/slapt-get-user/attachments/20090104/e3094326/attachment.bin>
More information about the Slapt-get-user
mailing list