configure: do not require hg when configuring in an hg clone
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740c57458bb354d
parent 1739 3dd3b6279985
child 1742 fc9c1c675802
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
configure
     1.1 --- a/configure	Sun Jan 17 11:57:53 2010 -0500
     1.2 +++ b/configure	Sun Jan 17 23:06:02 2010 +0100
     1.3 @@ -383,11 +383,10 @@
     1.4  
     1.5  # If this version is n hg clone, try to get the revision number
     1.6  # If we can't get the revision number, use date
     1.7 +printf "Computing version string... "
     1.8  case "${VERSION}" in
     1.9      *+hg|hg)
    1.10 -        has_or_abort prog=hg
    1.11 -        printf "Computing version string... "
    1.12 -        REVISION="$( hg id -n 2>/dev/null )"
    1.13 +        REVISION="$( hg id -n 2>/dev/null || true )"
    1.14          case "${REVISION}" in
    1.15              "")
    1.16                  VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
    1.17 @@ -400,7 +399,7 @@
    1.18          VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
    1.19          ;;
    1.20  esac
    1.21 -echo "${VERSION}"
    1.22 +printf "${VERSION}\n"
    1.23  
    1.24  #---------------------------------------------------------------------
    1.25  # Compute and check install paths