Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
0924b5e1
Commit
0924b5e1
authored
Jun 18, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version.sh: add script to extract version number from header files
parent
db19c2ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
version.sh
version.sh
+30
-0
No files found.
version.sh
0 → 100755
View file @
0924b5e1
#!/usr/bin/env sh
#
# This script extracts the version from the project header file
#
# This script is based on CZMQ version.sh script located at:
# https://github.com/zeromq/czmq/blob/master/version.sh
project
=
$1
appendix
=
"_classes"
if
[
!
-f
include/
$project$appendix
.h
]
;
then
echo
"version.sh: error: could not open file include/
$project$appendix
.h"
1>&2
exit
1
fi
MAJOR
=
`
egrep
'^#define .*_VERSION_MAJOR +[0-9]+$'
include/
$project$appendix
.h
`
MINOR
=
`
egrep
'^#define .*_VERSION_MINOR +[0-9]+$'
include/
$project$appendix
.h
`
PATCH
=
`
egrep
'^#define .*_VERSION_PATCH +[0-9]+$'
include/
$project$appendix
.h
`
if
[
-z
"
$MAJOR
"
-o
-z
"
$MINOR
"
-o
-z
"
$PATCH
"
]
;
then
echo
"version.sh: error: could not extract version from include/
$project$appendix
.h"
1>&2
exit
1
fi
MAJOR
=
`
echo
$MAJOR
|
awk
'{ print $3 }'
`
MINOR
=
`
echo
$MINOR
|
awk
'{ print $3 }'
`
PATCH
=
`
echo
$PATCH
|
awk
'{ print $3 }'
`
echo
$MAJOR
.
$MINOR
.
$PATCH
|
tr
-d
'\n'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment