From 588a53f58df2a32362698c2bebea7b3b4910e261 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sat, 10 Jan 2015 09:32:07 +0000 Subject: 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. Corresponding to flashrom svn r1862. Signed-off-by: Stefan Tauner Acked-by: Stefan Tauner --- util/getrevision.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util') 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} [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}" -- cgit v1.1