support/download/hg: fix broken method

Commit 54d3d94b6e broke the 'hg' download
method, in a similar way as it broke the 'git' download method (later fixed
with commit b70ce56651), by introducing extra
output on stdout in a case where the output is redirected.

In the case of 'hg', the 'hg archive' step uses shell redirection rather
than directly letting hg write the output file, since commit
76b51f90c0.

As a result, the extra print added by the _hg function is prepended to the
actual archive, causing an invalid archive.

Fix by using the _plain_hg function instead. The disadvantage is that the
command for 'hg archive' is no longer printed.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Thomas De Schampheleire 2021-04-27 21:45:44 +02:00 committed by Yann E. MORIN
parent c5aedfe041
commit 4d6c6b1bd4

View File

@ -45,6 +45,6 @@ _plain_hg() {
_hg clone ${quiet} "${@}" --noupdate "'${uri}'" "'${basename}'"
_hg archive ${quiet} --repository "'${basename}'" --type tgz \
_plain_hg archive ${quiet} --repository "'${basename}'" --type tgz \
--prefix "'${basename}'" --rev "'${cset}'" \
- >"${output}"