<commit_before>#! /bin/sh

# Generate a resource file holding the version info for a FILENAME / EXE.
# Called as
#    makeresource.sh <FILENAME>
# it will generate <FILENAME>.rc to be compiled with
#    %.res: %.rc
#		     rc -fo"$@" $< $CXXFLAGS
# This .res file can then be passed to the linker like an object file.
#
# Author: Axel, 2009.

FILENAME=$1

FILEBASE=`basename $FILENAME`
RC=$FILENAME.rc
FILESTEM=${FILEBASE%.*}

if [ "x`echo $FILENAME| grep -i '\.DLL$'`" = "x${FILENAME}" ]; then
	RCFILETYPE=VFT_DLL
	RCFILETITLE=library
else
	RCFILETYPE=VFT_APP
	RCFILETITLE=application
fi
if [ "$FILEBASE" = "root.exe" ]; then
	RCFILEICON="101 ICON \"icons/RootIcon.ico\""
else
	RCFILEICON=
fi

# Use svninfo.txt: more precise than the info in Rversion.h
SVNBRANCH=`cat etc/svninfo.txt|head -n1`
SVNREV=`cat etc/svninfo.txt|head -n2|tail -n1`
SVNDATE="`cat etc/svninfo.txt|tail -n1`"
SVNYEARCOMMA=`echo $SVNDATE|cut -d' ' -f3`

# Can't do that inside the .rc file: FILEVERSION doesn't evaluate a>>b
VERSION=`grep "ROOT_RELEASE " include/RVersion.h | sed 's,^.*"\([^"]*\)".*$,\1,' | sed 's,[^[:digit:]], ,g'`
VER1=`echo $VERSION| cut -d ' ' -f 1| sed 's,^0\+,,'`
VER2=`echo $VERSION| cut -d ' ' -f 2| sed 's,^0\+,,'`
VER3=`echo $VERSION| cut -d ' ' -f 3| sed 's,^0\+,,'`

# 0: tag, 1: trunk, 2: branch
VERBRANCHFLAG=1
if [ "x${SVNBRANCH/tag/}" != "x${SVNBRANCH}" ]; then
   VERBRANCHFLAG=0
elif [ "x${SVNBRANCH/branch/}" != "x${SVNBRANCH}" ]; then
   VERBRANCHFLAG=2
fi

DATE="`date +'%F %T'`"
HOST=`hostname`<commit_msg>From Bertrand: correct version determination.<commit_after>#! /bin/sh

# Generate a resource file holding the version info for a FILENAME / EXE.
# Called as
#    makeresource.sh <FILENAME>
# it will generate <FILENAME>.rc to be compiled with
#    %.res: %.rc
#		     rc -fo"$@" $< $CXXFLAGS
# This .res file can then be passed to the linker like an object file.
#
# Author: Axel, 2009.

FILENAME=$1

FILEBASE=`basename $FILENAME`
RC=$FILENAME.rc
FILESTEM=${FILEBASE%.*}

if [ "x`echo $FILENAME| grep -i '\.DLL$'`" = "x${FILENAME}" ]; then
	RCFILETYPE=VFT_DLL
	RCFILETITLE=library
else
	RCFILETYPE=VFT_APP
	RCFILETITLE=application
fi
if [ "$FILEBASE" = "root.exe" ]; then
	RCFILEICON="101 ICON \"icons/RootIcon.ico\""
else
	RCFILEICON=
fi

# Use svninfo.txt: more precise than the info in Rversion.h
SVNBRANCH=`cat etc/svninfo.txt|head -n1`
SVNREV=`cat etc/svninfo.txt|head -n2|tail -n1`
SVNDATE="`cat etc/svninfo.txt|tail -n1`"
SVNYEARCOMMA=`echo $SVNDATE|cut -d' ' -f3`

# Can't do that inside the .rc file: FILEVERSION doesn't evaluate a>>b
VERSION=`grep "ROOT_RELEASE " include/RVersion.h | sed 's,^.*"\([^"]*\)".*$,\1,' | sed 's,[^[:digit:]], ,g'`
VER1=`echo $VERSION| cut -d ' ' -f 1| sed 's,^0,,'`
VER2=`echo $VERSION| cut -d ' ' -f 2| sed 's,^0,,'`
VER3=`echo $VERSION| cut -d ' ' -f 3| sed 's,^0,,'`

# 0: tag, 1: trunk, 2: branch
VERBRANCHFLAG=1
if [ "x${SVNBRANCH/tag/}" != "x${SVNBRANCH}" ]; then
   VERBRANCHFLAG=0
elif [ "x${SVNBRANCH/branch/}" != "x${SVNBRANCH}" ]; then
   VERBRANCHFLAG=2
fi

DATE="`date +'%F %T'`"
HOST=`hostname`
{'fraction_non_alphanumeric': 0.19569471624266144, 'fraction_numerical': 0.018917155903457272, 'mean_word_length': 4.278829604130809, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6311633', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1283, 'n_words': 333}