From 3c166ae93aa3f544f5ff9ee85187c121f37a85e3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 18 Jun 2014 10:49:51 +0200 Subject: [PATCH] contrib/rpm: improve usage output of build_clean.sh script Signed-off-by: Thomas Haller (cherry picked from commit bf0b08ad55cb644b1821d950ce8e631b05215e35) --- contrib/fedora/rpm/build_clean.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh index af3465fe41..f14f55f923 100755 --- a/contrib/fedora/rpm/build_clean.sh +++ b/contrib/fedora/rpm/build_clean.sh @@ -7,10 +7,13 @@ die() { } usage() { - echo "USAGE: $0 [-h|--help|-?|help]" + echo "USAGE: $0 [-h|--help|-?|help] [-f|--force] [-c|--clean]" echo echo "Does all the steps from a clean working directory to an RPM of NetworkManager" echo + echo "Options:" + echo " --force: force build, even if working directory is not clean and has local modifications" + echo " --clean: run \`git-clean -fdx :/\` before build" } @@ -53,11 +56,11 @@ if [[ $IGNORE_DIRTY != 1 ]]; then # check for a clean working directory. # We ignore the /contrib directory, because this is where the automation # scripts and the build results will be. - if [[ "x$(git clean -ndx | grep '^Would remove contrib/.*$' -v)" != x ]]; then - die "The working directory is not clean. Refuse to run. Try git clean -e /contrib -dx -n" + if [[ "x$(LANG=C git clean -ndx | grep '^Would remove contrib/.*$' -v)" != x ]]; then + die "The working directory is not clean. Refuse to run. Try \`$0 --force\`, \`$0 --clean\`, or \`git clean -e :/contrib -dx -n\`" fi if [[ "x$(git status --porcelain)" != x ]]; then - die "The working directory has local changes. Refuse to run. Try $0 --force" + die "The working directory has local changes. Refuse to run. Try \`$0 --force\`" fi fi