summaryrefslogtreecommitdiff
path: root/0.8/scripts/buildnr.pl
blob: ee3d3e243d87f784dfbd79fec91c3989d1e1b14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

# The yChat Project (2003)
#
# This script increases the BUILNR of msgs,h each time the yChat
# gets recompiled!

use strict;

open MSGS, "src/msgs.h";
my @msgs = <MSGS>;
close MSGS;

foreach (@msgs)
{
 if ( /define BUILDNR/ )
 {
  s/(BUILDNR )(.+)$/$1.($2+1)/e;
  print;
  next;
 }
}

open MSGS, ">src/msgs.h";
print MSGS @msgs;
close MSGS;