Patchwork [2,of,4] build: the initial version detection by make deb/rpm could fail due to missing quoting

login
register
mail settings
Submitter via Mercurial-devel
Date Oct. 11, 2017, 8:46 p.m.
Message ID <fc144c0ec36089c4b60b.1507754778@cuben>
Download mbox | patch
Permalink /patch/24759/
State Accepted
Headers show

Comments

via Mercurial-devel - Oct. 11, 2017, 8:46 p.m.
# HG changeset patch
# User muxator <a.mux@inwind.it>
# Date 1507678663 -7200
#      Wed Oct 11 01:37:43 2017 +0200
# Node ID fc144c0ec36089c4b60bb3287adc787a1cfcae78
# Parent  f5b679cb5f18ed7f29c42d7a66a3b3a172a11286
build: the initial version detection by make deb/rpm could fail due to missing quoting

Patch

diff --git a/contrib/packagelib.sh b/contrib/packagelib.sh
--- a/contrib/packagelib.sh
+++ b/contrib/packagelib.sh
@@ -12,9 +12,9 @@ 
     make local || make local PURE=--pure
     HG="$PWD/hg"
 
-    $HG version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; }
+    "$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 "$HG" version | sed -ne 's/.*(version \(.*\))$/\1/p'`
 
     if echo $hgversion | grep + > /dev/null 2>&1 ; then
         tmp=`echo $hgversion | cut -d+ -f 2`