Patchwork [3,of,3] packagelib: use LANGUAGE=C for "hg version"

login
register
mail settings
Submitter Toshi MARUYAMA
Date June 11, 2017, 7:11 p.m.
Message ID <64418ff7b1da8dfe95e3.1497208290@raidcentos7n01>
Download mbox | patch
Permalink /patch/21332/
State Accepted
Headers show

Comments

Toshi MARUYAMA - June 11, 2017, 7:11 p.m.
# HG changeset patch
# User Toshi MARUYAMA <marutosijp2@gmail.com>
# Date 1497205438 -32400
#      Mon Jun 12 03:23:58 2017 +0900
# Node ID 64418ff7b1da8dfe95e3591625bc6a4d16ca03fc
# Parent  e4120dbf3b1564464fd75f5a7fa1f4222948b0f0
packagelib: use LANGUAGE=C for "hg version"

If "hg version" does not contain "version" (e.g. Japanese),
$hgversion was empty and rpmbuild failed.
Sean Farley - June 12, 2017, 1:30 a.m.
Toshi MARUYAMA <marutosijp2@gmail.com> writes:

> # HG changeset patch
> # User Toshi MARUYAMA <marutosijp2@gmail.com>
> # Date 1497205438 -32400
> #      Mon Jun 12 03:23:58 2017 +0900
> # Node ID 64418ff7b1da8dfe95e3591625bc6a4d16ca03fc
> # Parent  e4120dbf3b1564464fd75f5a7fa1f4222948b0f0
> packagelib: use LANGUAGE=C for "hg version"
>
> If "hg version" does not contain "version" (e.g. Japanese),
> $hgversion was empty and rpmbuild failed.

These seem really straight-forward, so I've queued them :-) Thanks!

Patch

diff --git a/contrib/packagelib.sh b/contrib/packagelib.sh
--- a/contrib/packagelib.sh
+++ b/contrib/packagelib.sh
@@ -14,7 +14,7 @@  gethgversion() {
 
     $HG version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; }
 
-    hgversion=`$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`