diff --git a/contrib/packaging/buildrpm b/contrib/packaging/buildrpm --- a/contrib/packaging/buildrpm +++ b/contrib/packaging/buildrpm @@ -56,7 +56,7 @@ exit 1 fi -gethgversion +gethgversion $PYTHONEXE if [ -z "$type" ] ; then release=1 @@ -76,7 +76,7 @@ fi mkdir -p $RPMBUILDDIR/{SOURCES,BUILD,SRPMS,RPMS} -$HG archive -t tgz $RPMBUILDDIR/SOURCES/mercurial-$version-$release.tar.gz +$PYTHONEXE $HG archive -t tgz $RPMBUILDDIR/SOURCES/mercurial-$version-$release.tar.gz if [ "$PYTHONVER" ]; then ( mkdir -p build @@ -112,7 +112,7 @@ if echo $version | grep '+' > /dev/null 2>&1; then latesttag="`echo $version | sed -e 's/+.*//'`" - $HG log -r .:"$latesttag" -fM \ + $PYTHONEXE $HG log -r .:"$latesttag" -fM \ --template '{date|hgdate}\t{author}\t{desc|firstline}\n' | python -c ' import sys, time @@ -136,9 +136,9 @@ else - $HG log \ + $PYTHONEXE $HG log \ --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \ - .hgtags | python -c ' + .hgtags | $PYTHONEXE -c ' import sys, time def datestr(date, format): diff --git a/contrib/packaging/packagelib.sh b/contrib/packaging/packagelib.sh --- a/contrib/packaging/packagelib.sh +++ b/contrib/packaging/packagelib.sh @@ -8,16 +8,21 @@ # # node: the node|short hg was built from, or empty if built from a tag gethgversion() { + if [ -z "${1+x}" ]; then + python="python" + else + python="$1" + fi export HGRCPATH= export HGPLAIN= - make cleanbutpackages - make local PURE=--pure + make cleanbutpackages PYTHON=$python + make local PURE=--pure PYTHON=$python HG="$PWD/hg" - "$HG" version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; } + $python "$HG" version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; } - hgversion=`LANGUAGE=C "$HG" version | sed -ne 's/.*(version \(.*\))$/\1/p'` + hgversion=`LANGUAGE=C $python "$HG" version | sed -ne 's/.*(version \(.*\))$/\1/p'` if echo $hgversion | grep + > /dev/null 2>&1 ; then tmp=`echo $hgversion | cut -d+ -f 2`