[patch-o-matic-ng] Support new iptables source tree format.

netfilter-cvslog-bounces at lists.netfilter.org netfilter-cvslog-bounces at lists.netfilter.org
Tue Jun 17 10:59:57 CEST 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=patch-o-matic-ng.git;a=commit;h=327e2469748dda48e8e9749389c447cf3ed63ecf
commit 327e2469748dda48e8e9749389c447cf3ed63ecf
Author:     Jozsef Kadlecsik <kadlec at blackhole.kfki.hu>
AuthorDate: Tue Jun 17 10:47:00 2008 +0200
Commit:     Jozsef Kadlecsik <kadlec at blackhole.kfki.hu>
CommitDate: Tue Jun 17 10:47:00 2008 +0200

    Support new iptables source tree format.
       via  327e2469748dda48e8e9749389c447cf3ed63ecf (commit)
      from  b6d07ed9ee7d643889002c091335828e5a5aa74f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 327e2469748dda48e8e9749389c447cf3ed63ecf
Author: Jozsef Kadlecsik <kadlec at blackhole.kfki.hu>
Date:   Tue Jun 17 10:47:00 2008 +0200

    Support new iptables source tree format.

-----------------------------------------------------------------------

 Netfilter_POM.pm |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/Netfilter_POM.pm b/Netfilter_POM.pm
index dad8140..e86e2e0 100644
--- a/Netfilter_POM.pm
+++ b/Netfilter_POM.pm
@@ -123,21 +123,27 @@ sub linuxversion {
 sub iptablesversion {
 	my $self = shift;
 	my($version);
-
-	open(MAKEFILE, "$self->{projects}->{iptables}->{PATH}/Makefile")
-		or croak "Missing Makefile from $self->{projects}->{iptables}->{PATH}!";
-	while (my $line = <MAKEFILE>) {
+	my(%sources) = (
+	  'Makefile'		=> qr/^IPTABLES_VERSION:=(\S+)/,
+	  '/include/xtables.h'	=> qr/^\#define XTABLES_VERSION "(\S+)"/,
+	); 
+
+	foreach my $file (keys %sources) {
+	    open(FILE, "$self->{projects}->{iptables}->{PATH}/$file")
+		or next;
+            while (my $line = <FILE>) {
 		chomp($line);
-		if ($line =~ /^IPTABLES_VERSION:=(\S+)/) {
+		if ($line =~ /$sources{$file}/) {
 			$version = $1;
 			# don't support versioning like 1.2.3b!
 			$version =~ s/[^\d\.]//g;
-			close(MAKEFILE);
+			close(FILE);
 			$self->{projects}->{iptables}->{VERSION} = $version;
 			return;
 		}
-	}
-	close(MAKEFILE);
+            }
+            close(FILE);
+        }
 	croak "Makefile in $self->{projects}->{iptables}->{PATH} does not contain iptables version!";
 }
 



More information about the netfilter-cvslog mailing list