summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2015-01-10 09:32:07 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2015-01-10 09:32:07 +0000
commit9f7e72eef825f6c3a2f672d220c657fd269d7289 (patch)
treeea4421ce2f5d172063cb4414447b063fdf445c3d /util
parent5b0f5f52f8e4e9383e13e41581f0c649950d7865 (diff)
downloadflashrom-9f7e72eef825f6c3a2f672d220c657fd269d7289.tar.gz
Refine revision handling.
Up to now, when compiling flashrom outside a VCS it would print two warnings that are not very clear to the user. This patch adds a new auxilary function to getrevision.sh and uses it in the makefile to print a single and more meaningful message to the user while hiding the warnings from getrevision.sh. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1862 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rwxr-xr-xutil/getrevision.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/getrevision.sh b/util/getrevision.sh
index e50db75..1012058 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -215,6 +215,10 @@ upstream_revision() {
echo "${r}"
}
+is_tracked() {
+ is_file_tracked "$1"
+}
+
show_help() {
echo "Usage:
${0} <command> [path]
@@ -222,6 +226,8 @@ show_help() {
Commands
-h or --help
this message
+ -c or --check
+ test if path is under version control at all
-l or --local
local revision information including an indicator for uncommitted changes
-u or --upstream
@@ -274,6 +280,10 @@ main() {
check_action $1
action="timestamp +%Y-%m-%dT%H:%M:%SZ" # There is only one valid time format! ISO 8601
shift;;
+ -c|--check)
+ check_action=$1
+ action="is_tracked"
+ shift;;
-*)
show_help;
echo "Error: Invalid option: ${1}"