3 # increments the build version number.
5 #mkdir -p "$TEMPORARIES_PILE"
7 #hmmm: looks like repeated reusable code below (compare with next_version)
9 if [ ! -z "$BUILD_PARAMETER_FILE" ]; then
10 # define our version of the build parameter file. this should be set
11 # beforehand so we override the default parameter file for clam.
12 PARAMETER_FILE="$BUILD_PARAMETER_FILE"
14 if [ -z "$PARAMETER_FILE" ]; then
15 # last ditch attempt to get one that will work.
16 PARAMETER_FILE="$FEISTY_MEOW_APEX/build.ini"
19 #chmod u+w "$PARAMETER_FILE"
21 #new_buildini="$(mktemp "$TEMPORARIES_PILE/buildini.XXXXXX")"
22 ## whack the file just in case.
23 #rm -f "$new_buildini"
24 #echo -n "" >"$new_buildini"
26 # pick a weird separator that we hope never to see.
36 #hmmm: now i know i'm having deja vu. this loop is a big chunk of reusable code that should be abstracted from this file and from next_version
38 while read line_found; do
39 if [ $? != 0 ]; then break; fi
40 #echo line found is $line_found
41 if [ ! -z "$skip_line" ]; then
42 # we were told to skip this line to fix win32.
47 # these checks don't care about whether we've seen other stuff yet.
48 if [ -z "$major_string" ]; then
49 if [ ! -z "$(echo $line_found | sed -n -e 's/^ *major *=.*$/yep/p')" ]; then
50 major_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
53 if [ -z "$minor_string" ]; then
54 if [ ! -z "$(echo $line_found | sed -n -e 's/^ *minor *=.*$/yep/p')" ]; then
55 minor_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
59 # we process the revision string line specially.
60 if [ -z "$found_version" ]; then
61 if [ "$line_found" == "#[version]" ]; then
62 # repair our special escape that makes this a valid ini file and
63 # gnu make include file.
64 # echo -e "#\\\\\n[version]" >>"$new_buildini"
67 elif [ "$line_found" == "#" ]; then
68 # retarded win32 case.
69 # echo -e "#\\\\\n[version]" >>"$new_buildini"
74 elif [ -z "$revision_string" ]; then
75 if [ ! -z "$(echo $line_found | sed -n -e 's/^ *revision *=.*$/yep/p')" ]; then
76 revision_string=$(echo $line_found | sed -e 's/.*=\(.*\)$/\1/' )
77 #echo second part is $revision_string
78 revision_string=$(expr $revision_string + 1)
79 # echo "revision=$revision_string" >>"$new_buildini"
80 # don't print the line normally also.
85 # send the line with no special processing.
86 # echo "$line_found" >>"$new_buildini"
88 done <"$PARAMETER_FILE"
90 ## if we created something with contents, let's use it.
91 #if [ -s "$new_buildini" ]; then
92 # cp "$new_buildini" "$PARAMETER_FILE"
95 echo "Current build version is: $major_string.$minor_string.$revision_string"
97 # don't leave the temporary version files floating around.
98 #rm -f "$new_buildini"