File: set_wb_version

package info (click to toggle)
mysql-workbench 6.3.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 113,932 kB
  • ctags: 87,814
  • sloc: ansic: 955,521; cpp: 427,465; python: 59,728; yacc: 59,129; xml: 54,204; sql: 7,091; objc: 965; makefile: 638; sh: 613; java: 237; perl: 30; ruby: 6; php: 1
file content (86 lines) | stat: -rwxr-xr-x 3,381 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash


version=$1
major=`echo $version|cut -d. -f1`
minor=`echo $version|cut -d. -f2`
release=`echo $version|cut -d. -f3`
release_number=`echo $version|cut -d. -f3|sed -e 's/\([0-9]*\).*/\1/'`
build=`echo $version|cut -d. -f4`
release_type=$2
edition_name=$3
license_type=$4

echo "----------------------------------------------------"
echo "Setting workbench version"
echo "Version       : $1"
echo "Release Type  : $2"
echo "Edition       : $3"
echo "License       : $4"
echo "Parsed Version: $major.$minor.$release.$build"
echo "----------------------------------------------------"

if test "$build" = ""; then
    build=0
fi

if test "$version" = ""; then
    echo "$0 <major.minor.release[.build]> [<release-type>]"
    exit 1
fi

if test x$release_type != x; then
    dot_release_type=.$release_type
    space_release_type=" $release_type"
else
    dot_release_type=
    space_release_type=
fi

echo "Updating wb_version.h"
sed -e "s/#define APP_MAJOR_NUMBER.*/#define APP_MAJOR_NUMBER $major/" \
    -e "s/#define APP_MINOR_NUMBER.*/#define APP_MINOR_NUMBER $minor/" \
    -e "s/#define APP_RELEASE_NUMBER.*/#define APP_RELEASE_NUMBER $release_number/" \
    -e "s/#define APP_RELEASE_TYPE.*/#define APP_RELEASE_TYPE \"$release_type\"/" \
    -e "s/#define APP_BUILD_NUMBER.*/#define APP_BUILD_NUMBER $build/" \
    -i.bak backend/wbprivate/workbench/wb_version.h 

if test "$edition_name" != "" -a "$license_type" != ""; then
sed -e "s/#define APP_LICENSE_TYPE.*/#define APP_LICENSE_TYPE \"$license_type\"/" \
    -e "s/#define APP_EDITION_NAME.*/#define APP_EDITION_NAME \"$edition_name\"/" \
    -i.bak backend/wbprivate/workbench/wb_version.h 
fi

echo "Updating AssemblyInfo.cs"
sed -e "s/\[assembly: AssemblyVersion(.*)\]/[assembly: AssemblyVersion(\"$major.$minor.$release_number\")]/"\
    -e "s/\[assembly: AssemblyFileVersion(.*)\]/[assembly: AssemblyFileVersion(\"$major.$minor.$release_number\")]/" \
    -e "s/\[assembly: AssemblyReleaseType(.*)\]/[assembly: AssemblyReleaseType(\"$release_type\")]/" \
    -i.bak frontend/windows/MySQLWorkbench/Properties/AssemblyInfo.cs

if test "$edition_type" != ""; then
sed -e "s/\[assembly: AssemblyConfiguration(.*)\]/[assembly: AssemblyConfiguration(\"$edition_type\")]/"\
    -i.bak frontend/windows/MySQLWorkbench/Properties/AssemblyInfo.cs
fi

echo "Updating Info.plist"
sed -e "/<key>CFBundleShortVersionString<\/key>/N;s/.*\n.*<\/string>/	<key>CFBundleShortVersionString<\/key>@	<string>$major.$minor.$release$dot_release_type<\/string>/" -e 'y/@/\n/' -i.bak Info.plist

echo "Updating mysql-workbench.spec.in"
sed -e "s/--define='version.*'/--define='version $major.$minor.$release_number'/" -i.bak build/mysql-workbench.spec.in

# check if build/debian.in/changelog needs update
echo "Checking if build/debian.in/changelog needs updating"
if ! grep $major.$minor.$release- build/debian.in/changelog; then
    echo "build/debian.in/changelog needs update, adding a new entry"
    cat <<EOF > build/debian.in/changelog.new
mysql-workbench-@edition@ ($major.$minor.$release$dot_release_type-1@distrov@) @distro@; urgency=low

  * New release

 -- `git config user.name` (`git config user.email`)  `date +"%a, %d %b %Y %T %z"`

EOF
    cat build/debian.in/changelog >> build/debian.in/changelog.new
    mv -f build/debian.in/changelog.new build/debian.in/changelog
    head -10 build/debian.in/changelog
fi