Integrate the "find . -name Entries" into make-version.pl, to make this

work with nmake too.

svn path=/trunk/; revision=9694
This commit is contained in:
Jörg Mayer 2004-01-17 13:09:00 +00:00
parent 8020cdf176
commit 1ae6e43f5d
3 changed files with 29 additions and 10 deletions

View File

@ -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 <gerald@ethereal.com>
@ -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.

View File

@ -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 <win32.mak>
@ -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;

View File

@ -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 <gerald@ethereal.com>
@ -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 (<FILE>) {
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 "" ) {