perl-Glib r1098 - trunk



Author: tsch
Date: Sat Feb 21 13:46:49 2009
New Revision: 1098
URL: http://svn.gnome.org/viewvc/perl-Glib?rev=1098&view=rev

Log:
(xsdoc2pod): Instead of relying on one final '=cut', close every opened POD
paragraph separately.  This fixes POD errors that occurred when '=for position
COPYRIGHT' was used.  Original patch by Ryan Niebur.


Modified:
   trunk/ChangeLog
   trunk/GenPod.pm

Modified: trunk/GenPod.pm
==============================================================================
--- trunk/GenPod.pm	(original)
+++ trunk/GenPod.pm	Sat Feb 21 13:46:49 2009
@@ -272,9 +272,12 @@
 			blurb => $pkgdata->{blurb},
 		};
 
+		# podify_pods() always returns proper POD with a =cut at the
+		# end.  But all the other =head1 below need a closing =cut.
+
 		print "=head1 NAME\n\n$package";
 		print ' - '.$pkgdata->{blurb} if (exists ($pkgdata->{blurb}));
-		print "\n\n";
+		print "\n\n=cut\n\n";
 
 		#                   pods            , position 
 		$ret = podify_pods ($pkgdata->{pods}, 'SYNOPSIS');
@@ -285,13 +288,13 @@
 		
 		my $parents;
 		($ret, $parents) = podify_ancestors ($package);
-		print "=head1 HIERARCHY\n\n$ret" if ($ret);
+		print "=head1 HIERARCHY\n\n$ret\n\n=cut\n\n" if ($ret);
 		
 		$ret = podify_pods ($pkgdata->{pods}, 'post_hierarchy');
 		print "$ret\n\n" if ($ret);
 		
 		$ret = podify_interfaces ($package);
-		print "=head1 INTERFACES\n\n$ret" if ($ret);
+		print "=head1 INTERFACES\n\n$ret\n\n=cut\n\n" if ($ret);
 		
 		$ret = podify_pods ($pkgdata->{pods}, 'post_interfaces');
 		print "$ret\n\n" if ($ret);
@@ -300,28 +303,28 @@
 		print "$ret\n\n" if ($ret);
 
 		$ret = podify_deprecated_by ($package, @{ $pkgdata->{deprecated_bys} });
-		print "\n=head1 DEPRECATION WARNING\n\n$ret" if ($ret);
+		print "\n=head1 DEPRECATION WARNING\n\n$ret\n\n=cut\n\n" if ($ret);
 
 		$ret = podify_methods ($package, $pkgdata->{xsubs});
-		print "\n=head1 METHODS\n\n$ret" if ($ret);
+		print "\n=head1 METHODS\n\n$ret\n\n=cut\n\n" if ($ret);
 		
 		$ret = podify_pods ($pkgdata->{pods}, 'post_methods');
 		print "$ret\n\n" if ($ret);
 
 		$ret = podify_properties ($package);	
-		print "\n=head1 PROPERTIES\n\n$ret" if ($ret);
+		print "\n=head1 PROPERTIES\n\n$ret\n\n=cut\n\n" if ($ret);
 
 		$ret = podify_pods ($pkgdata->{pods}, 'post_properties');
 		print "$ret\n\n" if ($ret);
 
 		$ret = podify_signals ($package);	
-		print "\n=head1 SIGNALS\n\n$ret" if ($ret);
+		print "\n=head1 SIGNALS\n\n$ret\n\n=cut\n\n" if ($ret);
 
 		$ret = podify_pods ($pkgdata->{pods}, 'post_signals');
 		print "$ret\n\n" if ($ret);
 
 		$ret = podify_enums_and_flags ($pkgdata, $package);	
-		print "\n=head1 ENUMS AND FLAGS\n\n$ret" if ($ret);
+		print "\n=head1 ENUMS AND FLAGS\n\n$ret\n\n=cut\n\n" if ($ret);
 
 		$ret = podify_pods ($pkgdata->{pods}, 'post_enums');
 		print "$ret\n\n" if ($ret);
@@ -342,7 +345,7 @@
 			                         $pkgdata->{see_alsos}
 						 ? @{ $pkgdata->{see_alsos} }
 			                         : ());
-			print "\n=head1 SEE ALSO\n\n$ret" if ($ret);
+			print "\n=head1 SEE ALSO\n\n$ret\n\n=cut\n\n" if ($ret);
 		}
 
 		$ret = podify_pods ($pkgdata->{pods}, 'COPYRIGHT');
@@ -355,11 +358,9 @@
 		{
 			# use normal copyright system
 			$ret = get_copyright ();
-			print "\n=head1 COPYRIGHT\n\n$ret" if ($ret);
+			print "\n=head1 COPYRIGHT\n\n$ret\n\n=cut\n\n" if ($ret);
 		}
 
-		print "\n=cut\n\n";
-
 		close POD;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]