r41680 - in /branches/upstream/libnet-libidn-perl/current: Changes LibIDN.xs META.yml Makefile.PL README _LibIDN.pm debian/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Tue Aug 11 23:11:13 UTC 2009


Author: ryan52-guest
Date: Tue Aug 11 23:11:07 2009
New Revision: 41680

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41680
Log:
[svn-upgrade] Integrating new upstream version, libnet-libidn-perl (0.12.ds)

Removed:
    branches/upstream/libnet-libidn-perl/current/debian/
Modified:
    branches/upstream/libnet-libidn-perl/current/Changes
    branches/upstream/libnet-libidn-perl/current/LibIDN.xs
    branches/upstream/libnet-libidn-perl/current/META.yml
    branches/upstream/libnet-libidn-perl/current/Makefile.PL
    branches/upstream/libnet-libidn-perl/current/README
    branches/upstream/libnet-libidn-perl/current/_LibIDN.pm

Modified: branches/upstream/libnet-libidn-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/Changes?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/Changes (original)
+++ branches/upstream/libnet-libidn-perl/current/Changes Tue Aug 11 23:11:07 2009
@@ -1,6 +1,27 @@
 Revision history for Perl extension Net::LibIDN.
 
-0.07  
+0.12  Thu Feb 26 13:44:06 CET 2009
+	- Applied NetBSD compatibility patch (Thanks Havard Eidnes), fixes #39294
+	- Applied Win32 memory free compatibility patch (Thanks CPAN user SISYPHUS),
+	  maybe fixes #43110
+
+0.11  Tue Aug 26 19:42:18 CEST 2008
+	- Move ldflags to back of cc test compile to improve the portability of
+	  Libidn installation checks yet again, 
+	  thanks to nix of esperi dot o r g dot uk 
+
+0.10  Thu Dec 13 00:18:56 CET 2007
+	- Shut up CPAN tester mails
+	- Correct some linitian problems
+
+0.09  Mon Aug  7 19:20:00 CEST 2006
+	- Minor doc changes
+
+0.08  Mon Jan 17 13:07:04 CET 2005
+	- Try cc as well as gcc when testing for a functioning Libidn-Installation in
+	  Makefile.PL to improve portability, thanks to Keith A Hackworth
+
+0.07  Mon Apr 14 11:44:05 CEST 2004
 	- More debianization fixes from Matthias Urlichs
 	- Makefile.PL remembers calling options in generated Makefile
 	- Rewrote tests to not depend on "de"-Tables

Modified: branches/upstream/libnet-libidn-perl/current/LibIDN.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/LibIDN.xs?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/LibIDN.xs (original)
+++ branches/upstream/libnet-libidn-perl/current/LibIDN.xs Tue Aug 11 23:11:07 2009
@@ -5,6 +5,7 @@
 #include <idna.h>
 #include <punycode.h>
 #include <stringprep.h>
+#include <idn-free.h>
 
 #ifdef HAVE_TLD
 #include <tld.h>
@@ -27,13 +28,13 @@
 		return NULL;
 
 	res = stringprep_profile(utf8, &output, profile, 0);
-	free(utf8);
+	idn_free(utf8);
 
 	if( (res != STRINGPREP_OK) || !output)
 		return NULL;
 
 	res_str = stringprep_convert(output, charset, "UTF-8");
-	free(output);
+	idn_free(output);
 
 	return res_str;
 }
@@ -96,7 +97,7 @@
 		if (utf8_str)
 		{
 			res = idna_to_ascii_8z(utf8_str, &tmp_str, flags);
-			free(utf8_str);
+			idn_free(utf8_str);
 		}
 		else
 		{
@@ -111,7 +112,7 @@
 		RETVAL
 	CLEANUP:
 		if (tmp_str)
-			free(tmp_str);
+			idn_free(tmp_str);
 
 
 char *
@@ -133,21 +134,21 @@
 		if (tmp_str)
 		{
 			res_str = stringprep_convert(tmp_str, charset, "UTF-8");
-			free(tmp_str);
-		}
-		else
-		{
-			XSRETURN_UNDEF;
-		}
-		if (!res_str)
-		{
-			XSRETURN_UNDEF;
-		}
-		RETVAL = res_str;
-	OUTPUT:
-		RETVAL
-	CLEANUP:
-		free(res_str);
+			idn_free(tmp_str);
+		}
+		else
+		{
+			XSRETURN_UNDEF;
+		}
+		if (!res_str)
+		{
+			XSRETURN_UNDEF;
+		}
+		RETVAL = res_str;
+	OUTPUT:
+		RETVAL
+	CLEANUP:
+		idn_free(res_str);
 
 
 char *
@@ -167,7 +168,7 @@
 		if (utf8_str)
 		{
 			q = stringprep_utf8_to_ucs4(utf8_str, -1, &len);
-			free(utf8_str);
+			idn_free(utf8_str);
 		}
 		else
 		{
@@ -182,7 +183,7 @@
 		tmp_str = malloc(MAX_DNSLEN*sizeof(char));
 		len2 = MAX_DNSLEN-1;
 		res = punycode_encode(len, q, NULL, &len2, tmp_str);
-		free(q);
+		idn_free(q);
 
 		if (res != PUNYCODE_SUCCESS)
 		{
@@ -201,7 +202,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -239,22 +240,22 @@
 		if (utf8_str)
 		{
 			res_str = stringprep_convert(utf8_str, charset, "UTF-8");
-			free(utf8_str);
-		}
-		else
-		{
-			XSRETURN_UNDEF;
-		}
-
-		if (!res_str)
-		{
-			XSRETURN_UNDEF;
-		}
-		RETVAL = res_str;
-	OUTPUT:
-		RETVAL
-	CLEANUP:
-		free(res_str);
+			idn_free(utf8_str);
+		}
+		else
+		{
+			XSRETURN_UNDEF;
+		}
+
+		if (!res_str)
+		{
+			XSRETURN_UNDEF;
+		}
+		RETVAL = res_str;
+	OUTPUT:
+		RETVAL
+	CLEANUP:
+		idn_free(res_str);
 
 
 char *
@@ -274,7 +275,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -294,7 +295,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 char *
 idn_prep_node(string, charset=default_charset)
@@ -313,7 +314,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -333,7 +334,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -353,7 +354,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -373,7 +374,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -393,7 +394,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 char *
@@ -413,7 +414,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 #ifdef HAVE_TLD
@@ -450,7 +451,7 @@
 			XSRETURN_UNDEF;
 		}
 		res = stringprep_profile(utf8_str, &tmp_str, "Nameprep", 0);
-		free(utf8_str);
+		idn_free(utf8_str);
 		if (res != STRINGPREP_OK)
 		{
 			XSRETURN_UNDEF;
@@ -458,18 +459,18 @@
 		if (tld)
 		{
 			q = stringprep_utf8_to_ucs4(tmp_str, -1, &len);
-			free(tmp_str);
+			idn_free(tmp_str);
 			if (!q)
 			{
 				XSRETURN_UNDEF;
 			}
 			res = tld_check_4t(q, len, &errpos, tld_table);
-			free(q);
+			idn_free(q);
 		}
 		else
 		{
 			res = tld_check_8z(tmp_str, &errpos, NULL);
-			free(tmp_str);
+			idn_free(tmp_str);
 		}
 		if (res == TLD_SUCCESS)
 		{
@@ -507,7 +508,7 @@
 	OUTPUT:
 		RETVAL
 	CLEANUP:
-		free(res_str);
+		idn_free(res_str);
 
 
 SV *

Modified: branches/upstream/libnet-libidn-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/META.yml?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/META.yml (original)
+++ branches/upstream/libnet-libidn-perl/current/META.yml Tue Aug 11 23:11:07 2009
@@ -1,10 +1,10 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Net-LibIDN
-version:      0.07
+version:      0.12
 version_from: LibIDN.pm
 installdirs:  site
 requires:
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30_01

Modified: branches/upstream/libnet-libidn-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/Makefile.PL?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-libidn-perl/current/Makefile.PL Tue Aug 11 23:11:07 2009
@@ -1,12 +1,14 @@
 use strict;
 use ExtUtils::MakeMaker;
 use Getopt::Long;
+use Config;
 
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
 
+my $options;
+my $testno=1;
 my %MakeParams = InitMakeParams();
-my $options;
 
 WriteMakefile(%MakeParams);
 
@@ -31,10 +33,7 @@
 		($] >= 5.005 ?	## Add these new keywords supported since 5.005
 		(ABSTRACT_FROM	=> 'LibIDN.pm', # retrieve abstract from module
 		AUTHOR			=> 'Thomas Jacob <jacob at internet24.de>') : ()),
-#		MAN3PODS		=> { 'LibIDN.pm' },
 		PM				=> { 'LibIDN.pm' => '$(INST_LIB)/Net/LibIDN.pm' },
-#		PL_FILES		=> {},
-#		EXE_FILES		=> [],
 		clean			=> { FILES => "test.pl LibIDN.pm" }
 	);
 	my ($libdir, $incdir, $disable_tld);
@@ -54,7 +53,7 @@
 	}
 	else
 	{
-		$Params{LIBS} = '-lidn';
+		$Params{LIBS} = $Config{ldflags} . ' -lidn';
 	}
 
 	if ($incdir)
@@ -68,7 +67,11 @@
 
 	my $libidn = CheckLibidn($Params{INC}, $Params{LIBS});
 
-	die "This module requires GNU Libidn, which could not be found.\n" unless $libidn;
+	unless($libidn)
+	{
+		print "This module requires GNU Libidn, which could not be found.\n" unless $libidn;
+		exit 0;
+	}
 
 	print "Found LibIDN, ";
 	print $libidn == 1? "without": "with";
@@ -143,6 +146,53 @@
 	}
 }
 
+sub CheckCCode
+{
+	my $code = shift;
+	my $cflags = shift;
+	my $ldflags = shift;
+	my $output = shift;
+	my $test = '__test'.$testno++;
+	local * FILE;
+
+	if (open(FILE, ">$test.c"))
+	{
+		print FILE $code;
+		close(FILE);
+	}
+	else
+	{
+		return 0;
+	}
+
+	foreach my $cc (qw/cc gcc/)
+	{
+		unlink($test);
+		system "$cc $cflags -o $test $test.c $ldflags";
+		next if ($? >> 8);
+
+		if (open(FILE, "./$test|"))
+		{
+			my $match;
+			while(<FILE>)
+			{
+				$match = 1 if $_ eq $output;
+				last;
+			}
+			close(FILE);
+			next unless $match;
+		}
+		else
+		{
+			next;
+		}
+		unlink($test);
+		unlink("$test.c");
+		return 1;
+	}
+	return 0;
+}
+
 sub CheckLibidn
 {
 	my $cflags = shift;
@@ -161,29 +211,11 @@
 	
 	res = idna_to_ascii_8z("libidn", &output, 0);
 	printf("%d-%s", res, output);
+
+	return 0;
 }
 EOT
-
-	open(FILE, ">__test1.c");
-	print FILE $test1;
-	close(FILE);
-
-	system "cc $cflags $ldflags -o __test1 __test1.c";
-	$final=1 if ($? >> 8);
-
-	unless ($final)
-	{
-		open(FILE, "./__test1|");
-		while(<FILE>)
-		{
-			$final=1 if $_ ne "0-libidn";
-		}
-		close(FILE);
-	}
-	unlink("__test1");
-	unlink("__test1.c");
-
-	return $result if ($final);
+	return $result unless CheckCCode($test1, $cflags, $ldflags, "0-libidn");
 
 	$result = 1;
 
@@ -197,30 +229,13 @@
 
 	res =tld_get_z ("libidn.idn", &output);	
 	printf("%d-%s", res, output);
+	
+	return 0;
 }
 EOT
 
-	open(FILE, ">__test2.c");
-	print FILE $test2;
-	close(FILE);
-
-	system "cc $cflags $ldflags -o __test2 __test2.c ";
-	$final = 1 if ($? >> 8);
-
-	unless ($final)
-	{
-		open(FILE, "./__test2|");
-		while(<FILE>)
-		{
-			$final = 1 if $_ ne "0-idn";
-		}
-		close(FILE);
-	}
-	unlink("__test2");
-	unlink("__test2.c");
+	return $result unless CheckCCode($test2, $cflags, $ldflags, "0-idn");
 	
-	return $result if $final;
-
 	return 2;
 }
 

Modified: branches/upstream/libnet-libidn-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/README?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/README (original)
+++ branches/upstream/libnet-libidn-perl/current/README Tue Aug 11 23:11:07 2009
@@ -1,4 +1,4 @@
-Net/LibIDN version 0.07
+Net/LibIDN version 0.12
 =======================
 
 This module provides Perl bindings for GNU Libidn by Simon Josefsson
@@ -31,14 +31,18 @@
 
 This module requires these other modules and libraries:
 
-  GNU Libidn >=0.4.0, >=0.3.5 (without TLD checking support)
-       (lower versions might work, don't know)
+  GNU Libidn >=0.5.0
+
+Linux hint: If Makefile.PL says that it cannot find GNU Libidn, even though
+you compiled/installed it, consider adding the location of the Libidn .so
+files to /etc/ld.so.conf. Also, take a look at the --with-libidn and
+--with-libidn-inc options.
 
 COPYRIGHT AND LICENCE
 
 			   Perl Module Net::LibIDN
 
-		       Copyright 2003-2004, Thomas Jacob, Internet24.de
+		       Copyright 2003-2009, Thomas Jacob, Internet24.de
 			   All rights reserved
 
     This program is free software; you can redistribute it and/or modify

Modified: branches/upstream/libnet-libidn-perl/current/_LibIDN.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-libidn-perl/current/_LibIDN.pm?rev=41680&op=diff
==============================================================================
--- branches/upstream/libnet-libidn-perl/current/_LibIDN.pm (original)
+++ branches/upstream/libnet-libidn-perl/current/_LibIDN.pm Tue Aug 11 23:11:07 2009
@@ -47,7 +47,7 @@
 	IDNA_ALLOW_UNASSIGNED
 	IDNA_USE_STD3_ASCII_RULES
 );
-our $VERSION = '0.07';
+our $VERSION = '0.12';
 
 # avoid prototyping error message
 
@@ -106,6 +106,8 @@
 
 1;
 __END__
+
+=encoding latin1
 
 =head1 NAME
 
@@ -245,6 +247,25 @@
 #ENDIF_TLD
 =back
 
+=head2 Limitations
+
+There is currently no support for Perl's unicode capabilities (man perlunicode).
+All input strings are assumed to be octet strings, all output strings are 
+generated as octet strings. Thus, if you require Perl's unicode features, you 
+will have to convert your strings manually. For example:
+
+=over 4
+
+use Encode;
+
+use Data::Dumper;
+
+print Dumper(Net::LibIDN::idn_to_unicode('xn--uro-j50a.com', 'utf-8'));
+
+print Dumper(decode('utf-8', Net::LibIDN::idn_to_unicode('xn--uro-j50a.com', 'utf-8')));
+
+=back
+
 =head1 AUTHOR
 
 Thomas Jacob, http://internet24.de




More information about the Pkg-perl-cvs-commits mailing list