mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 22:21:16 +02:00
getrevision.sh: Make sure we don't get translated output
(And explicitly require bash.) Corresponding to flashrom svn r1716. Signed-off-by: Joerg Mayer <jmayer@loplof.de> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:

committed by
Stefan Tauner

parent
3285d7f2c0
commit
d31d3c3b17
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# This file is part of the flashrom project.
|
# This file is part of the flashrom project.
|
||||||
#
|
#
|
||||||
@ -24,21 +24,24 @@
|
|||||||
EXIT_SUCCESS=0
|
EXIT_SUCCESS=0
|
||||||
EXIT_FAILURE=1
|
EXIT_FAILURE=1
|
||||||
|
|
||||||
|
# Make sure we don't get translated output
|
||||||
|
export LC_ALL=C
|
||||||
|
|
||||||
svn_revision() {
|
svn_revision() {
|
||||||
LC_ALL=C svnversion -cn . 2>/dev/null | \
|
svnversion -cn . 2>/dev/null | \
|
||||||
sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | \
|
sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | \
|
||||||
grep "[0-9]" ||
|
grep "[0-9]" ||
|
||||||
LC_ALL=C svn info . 2>/dev/null | \
|
svn info . 2>/dev/null | \
|
||||||
awk '/^Revision:/ {print $$2 }' | \
|
awk '/^Revision:/ {print $$2 }' | \
|
||||||
grep "[0-9]" ||
|
grep "[0-9]" ||
|
||||||
LC_ALL=C git svn info . 2>/dev/null | \
|
git svn info . 2>/dev/null | \
|
||||||
awk '/^Revision:/ {print $$2 }' | \
|
awk '/^Revision:/ {print $$2 }' | \
|
||||||
grep "[0-9]" ||
|
grep "[0-9]" ||
|
||||||
echo ''
|
echo ''
|
||||||
}
|
}
|
||||||
|
|
||||||
svn_url() {
|
svn_url() {
|
||||||
echo $(LC_ALL=C svn info 2>/dev/null |
|
echo $(svn info 2>/dev/null |
|
||||||
grep URL: |
|
grep URL: |
|
||||||
sed 's/.*URL:[[:blank:]]*//' |
|
sed 's/.*URL:[[:blank:]]*//' |
|
||||||
grep ^.
|
grep ^.
|
||||||
@ -54,8 +57,7 @@ svn_timestamp() {
|
|||||||
timestamp=$(date "${date_format} +")
|
timestamp=$(date "${date_format} +")
|
||||||
else
|
else
|
||||||
# No local changes, get date of the last log record.
|
# No local changes, get date of the last log record.
|
||||||
local last_commit_date=$(svn info | grep '^Last Changed Date:' | \
|
local last_commit_date=$(svn info | grep '^Last Changed Date:' | awk '{print $4" "$5" "$6}')
|
||||||
awk '{print $4" "$5" "$6}')
|
|
||||||
timestamp=$(date --utc --date "${last_commit_date}" \
|
timestamp=$(date --utc --date "${last_commit_date}" \
|
||||||
"${date_format} UTC")
|
"${date_format} UTC")
|
||||||
fi
|
fi
|
||||||
@ -108,7 +110,7 @@ git_timestamp() {
|
|||||||
|
|
||||||
git_url() {
|
git_url() {
|
||||||
# Only the first line of `git remote' is considered.
|
# Only the first line of `git remote' is considered.
|
||||||
echo $(LC_ALL=C git remote show origin 2>/dev/null |
|
echo $(git remote show origin 2>/dev/null |
|
||||||
grep 'Fetch URL:' |
|
grep 'Fetch URL:' |
|
||||||
sed 's/.*URL:[[:blank:]]*//' |
|
sed 's/.*URL:[[:blank:]]*//' |
|
||||||
grep ^.
|
grep ^.
|
||||||
|
Reference in New Issue
Block a user