diff --git a/build/jam/FileRules b/build/jam/FileRules index ec309c4733..22b9eb004e 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -373,7 +373,7 @@ rule DetermineHaikuRevision # root directory, so it gets updated when the revision changes due to # commits or merges. local gitIndex = index ; - local revisionFile = haiku-revision ; + local revisionFile = haiku-revision ; if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] { HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ; MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ; @@ -424,6 +424,12 @@ rule DetermineEffectiveHaikuRevision actions DetermineEffectiveHaikuRevision1 { revision=`sed -n 's,^\(hrev[0-9]*\).*,\1,p' "$(2:E=unknown-revision)"` + if [ -z "$revision" ]; then + echo "Error: unable to determine the effective Haiku revision." + echo " If you are using a Haiku clone without tags, you can set" + echo " the revision tag to use with e.g. HAIKU_REVISION=hrev43210" + exit 1 + fi echo "${revision:-0}" > "$(1)" } diff --git a/build/scripts/determine_haiku_revision b/build/scripts/determine_haiku_revision index 465180a12e..0796c8c2e0 100755 --- a/build/scripts/determine_haiku_revision +++ b/build/scripts/determine_haiku_revision @@ -31,8 +31,10 @@ if [ -z "$revision" -o "$lastBuiltRevision" != "$localRev" ]; then # last reachable hrev-(haiku-revision-)tag revision=`git describe --dirty --tags --match=hrev*` if [ -z "$revision" ]; then - # failed to find any hrev tags, use short hash instead - revision=`git rev-parse --short HEAD` + # failed to find any hrev tags, bail out + echo "Error: you are using a Haiku clone without tags, please set" + echo " the revision tag to use (e.g. HAIKU_REVISION=hrev43210)" + exit 1 elif echo "$revision" | grep -- '-' >/dev/null; then # HEAD is not directly a changeset from Haiku's central repo, so we # add the current branch name as additional info