mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Get the SHA1 when no tag is present
The 'git describe' command finds the most recent tag instead of the SHA1. When trying to build from a repository without any tags, for example in a fork, this causes the build to fail. Use the '--always' option to fallback to the SHA1 in case no tag is present. Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
This commit is contained in:
parent
71ebee8ab6
commit
b358c71ade
2 changed files with 2 additions and 2 deletions
|
@ -379,7 +379,7 @@ for ARCH in $ARCHITECTURES ; do
|
|||
make install
|
||||
popd
|
||||
|
||||
CURRENT_SHA=$(cd "$SUBSURFACE_SOURCE"/libdivecomputer ; git describe)
|
||||
CURRENT_SHA=$(cd "$SUBSURFACE_SOURCE"/libdivecomputer ; git describe --always --long)
|
||||
PREVIOUS_SHA=$(cat "libdivecomputer-${ARCH}.SHA" 2>/dev/null || echo)
|
||||
if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] || [ ! -e "$PKG_CONFIG_PATH/libdivecomputer.pc" ] ; then
|
||||
mkdir -p libdivecomputer-build-"$ARCH"
|
||||
|
|
|
@ -264,7 +264,7 @@ if [ "$QUICK" != "1" ] ; then
|
|||
if [ ! -f "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA" ] ; then
|
||||
echo "" > "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA"
|
||||
fi
|
||||
CURRENT_SHA=$(cd "${SUBSURFACE_SOURCE}/libdivecomputer" ; git describe)
|
||||
CURRENT_SHA=$(cd "${SUBSURFACE_SOURCE}/libdivecomputer" ; git describe --always --long)
|
||||
PREVIOUS_SHA=$(cat "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA")
|
||||
if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] ; then
|
||||
echo "$CURRENT_SHA" > "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA"
|
||||
|
|
Loading…
Add table
Reference in a new issue