diff --git a/Makefile.am b/Makefile.am index e6c8fded69..82d1b1588a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.694 2004/01/16 22:18:59 guy Exp $ +# $Id: Makefile.am,v 1.695 2004/01/17 13:09:00 jmayer Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs @@ -1052,7 +1052,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap # Build the version string # cvsversion.h: - $(PERL) make-version.pl `find . -name "Entries"` + $(PERL) make-version.pl # # Build various header files for the X11 dissector. diff --git a/Makefile.nmake b/Makefile.nmake index d726c64bd7..87cc6a7380 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -1,7 +1,7 @@ ## Makefile for building ethereal.exe with Microsoft C and nmake ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # -# $Id: Makefile.nmake,v 1.391 2004/01/17 00:26:30 jmayer Exp $ +# $Id: Makefile.nmake,v 1.392 2004/01/17 13:09:00 jmayer Exp $ include config.nmake include @@ -628,7 +628,7 @@ ps.c : rdps.exe print.ps # Build the version string # cvsversion.h: - $(PERL) make-version.pl `find . -name "Entries"` + $(PERL) make-version.pl # # The header files listed here are built from x11-fields using Perl; diff --git a/make-version.pl b/make-version.pl index 2c52b4e6d1..590171b9aa 100755 --- a/make-version.pl +++ b/make-version.pl @@ -2,7 +2,7 @@ # # Copyright 2004 Jörg Mayer (see AUTHORS file) # -# $Id: make-version.pl,v 1.1 2004/01/16 20:03:10 jmayer Exp $ +# $Id: make-version.pl,v 1.2 2004/01/17 13:09:00 jmayer Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs @@ -22,7 +22,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# usage: ./make-version.pl `find . -name "Entries"` +# usage: ./make-version.pl use strict; @@ -36,22 +36,41 @@ my %asctonum = ( "Jan" => "01", "Feb" => "02", "Mar" => "03", "Apr" => "04", my $current; my $last = ""; -if ($#ARGV >= 0) { - while (<>) { + +sub findentries { + my $currentdir = shift; + + opendir(DIR, "$currentdir") || print STDERR "Opendir $currentdir failed ($!)\n" && next; + grep { (-d "$currentdir/$_" && $_ !~ /^\.(|.)$/ && &findentries("$currentdir/$_")) || + (-f "$currentdir/$_" && $_ =~ /^Entries$/ && &lastentry("$currentdir/$_")) } readdir(DIR); + closedir DIR; +} + +sub lastentry { + my $file = shift; + + open(FILE, "<$file") || print STDERR "Open $file for reading failed ($!)\n" && return 1; + while () { chomp; # Regular lines look like this: /ethereal_be.py/1.6/Fri Aug 2 22:55:19 2002// next if (/^D/); ($d1,$d2,$d2,$date,$drest) = split(/\//, $_, 5); next if ($date !~ /\d:\d\d:\d\d/); ($wdayascii, $monthascii, $day, $time, $year) = split(/\s+/, $date); - $day = substr("0".$day, 0, 2); + $day = substr("0".$day, -2, 2); $time =~ s/://g; $current = "$year$asctonum{$monthascii}$day$time"; if ($current gt $last) { $last = $current; } } -} elsif (-f "cvsversion") { + close FILE; + return 1; +} + +&findentries("."); + +if ($last eq "" && -f "cvsversion") { $last = `cat cvsversion`; } if ( $last ne "" ) {