Commit 2ba62438 authored by Mark Olesen's avatar Mark Olesen

CONFIG: refine handling of git information for debian builds

- When OpenFOAM is under git control and a 'debian/' directory exists,
  this could mean two things:

  1) Additional debian control has been added to OpenFOAM
  2) OpenFOAM has been imported into a debian project

For the case that OpenFOAM has been imported into a debian project,
using the git information would be highly misleading. There will be no
OpenFOAM SHA1 correspondence.

However, if additional debian control has been added to OpenFOAM the
SHA1 will be valid.

The ad hoc solution is to use an additional "openfoam.debian"
directory to flag the addition of debian controls into openfoam.

When a "debian/" directory exists without a "openfoam.debian", assume
that the OpenFOAM has been imported into debian and do not use the SHA1.
parent 5754beea
...@@ -29,10 +29,19 @@ ...@@ -29,10 +29,19 @@
# - debian : implicitly disables git queries # - debian : implicitly disables git queries
# #
# Note # Note
# When a 'debian/' directory exists, the '.git/' directory is most # There is a corner case when obtaining build information from git.
# likely from debian and not from OpenFOAM (ie, useless here). # It is possible that OpenFOAM has been imported into a debian form,
# This corresponds to an implicit '-no-git', which has no effect # in which case the '.git/' directory is most from debian and cannot
# when building from pristine sources. # be used to obtain an OpenFOAM sha1 value.
#
# Ad hoc logic (slightly messy):
# 1) Have an 'openfoam.debian/' directory.
# Assume that debian control has been added to OpenFOAM.
# Can use git to obtain build information.
# 2) Have a 'debian/' directory only.
# Assume OpenFOAM has been added into a debian project.
# Treat as '-no-git', which which has no effect
# when building from pristine sources.
# #
# SeeAlso # SeeAlso
# META-INFO/README.md for other routines that also use META-INFO. # META-INFO/README.md for other routines that also use META-INFO.
...@@ -145,8 +154,10 @@ done ...@@ -145,8 +154,10 @@ done
[ -d "$META_INFO" ] || \ [ -d "$META_INFO" ] || \
die "No ${META_INFO##*/}/ directory for project" die "No ${META_INFO##*/}/ directory for project"
# Disable git queries for debian packaging (see notes above) # Debian handling (see notes above)
if [ -d "$WM_PROJECT_DIR/debian" ] # - disable git queries if debian project and not internal "debianization"
if [ -d "$WM_PROJECT_DIR/debian" ] \
&& [ ! -e "$WM_PROJECT_DIR/openfoam.debian" ]
then then
unset FOAM_GIT_DIR unset FOAM_GIT_DIR
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment