import sys
import regex
import string
import os

files = sys.argv[1:]

fd = open ('version.h', 'r')

v_reg = regex.compile ('#define WINVN_VERSION "WinVN \([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)"')

line = fd.readline()

if v_reg.match(line) == -1:
	print 'something is wrong with version.h'
	sys.exit()

fd.close()

symbolic = "V" + v_reg.group(1) + "-" + v_reg.group(2) + "-" + v_reg.group(3)

print 'stamping current versions with symbolic version number '+ symbolic

for x in files:
	print x
	os.system ('rcs -n'+symbolic+': '+x)
