Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of version when inside git repo #492

Merged
merged 2 commits into from
Feb 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cnf/mkversionheader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ TMP="$1".tmp
DST="$1"

# Determine build version and date
GAP_BUILD_VERSION=`git describe --tags --dirty || echo`
GAP_BUILD_DATE=`date +"%Y-%m-%d %H:%M:%S (%Z)"`
if test x"${GAP_BUILD_VERSION}" = x ; then
if test -d ../.git ; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is wrong. The path ../.git is taken relative to the to current working directory (cwd / pwd), not relative to the script. But the script is invoked from the Makefile, which is in the GAP root directory.

GAP_BUILD_VERSION=`git describe --tags --dirty || echo`
else
GAP_BUILD_VERSION=unknown
fi
GAP_BUILD_DATE=`date +"%Y-%m-%d %H:%M:%S (%Z)"`

# Generate the file
cat > "$TMP" <<EOF
Expand Down
2 changes: 2 additions & 0 deletions lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ CallAndInstallPostRestore( function()
haveint[i]:= IntHexString( have[i] );
needint[i]:= IntHexString( need[i] );
od;
Print( "Current kernel version: ", haveint[1], ".", haveint[2], ".", haveint[3], "\n" );
Print( "Library requires version: ", needint[1], ".", needint[2], ".", needint[3], "\n" );

if haveint > needint then
# kernel newer
Expand Down