From 0a755e5ea583a17b80c4b3de1020b21c049ec5a2 Mon Sep 17 00:00:00 2001 From: Erik Karlsson Date: Thu, 9 Nov 2023 20:31:12 +0100 Subject: [PATCH] iop: genconfig: add option for ignoring dirty tree Add -D option which ignores dirty tree when determining version. --- iop/scripts/genconfig.sh | 5 ++++- iop/scripts/genconfig_min.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/iop/scripts/genconfig.sh b/iop/scripts/genconfig.sh index a3556984a..873347cfe 100755 --- a/iop/scripts/genconfig.sh +++ b/iop/scripts/genconfig.sh @@ -2,6 +2,7 @@ function genconfig { export CLEAN=0 + export DIRTY="--dirty" export IMPORT=1 export SRCTREEOVERR=0 export FILEDIR="files/" @@ -198,6 +199,7 @@ function genconfig { echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]" echo echo -e " -c|--clean\t\tRemove all files under ./files and import from config " + echo -e " -D|--no-dirty\t\tIgnore dirty tree" echo -e " -v|--verbose\t\tVerbose" echo -e " -n|--no-update\tDo NOT! Update customer config before applying" echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from" @@ -416,7 +418,7 @@ function genconfig { # Set target version local git_version - if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then + if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then echo "ERROR: Failed getting version via git describe, exiting." >&2 return 1 fi @@ -483,6 +485,7 @@ function genconfig { case "$1" in -c|--clean) export CLEAN=1;; + -D|--no-dirty) export DIRTY="";; -n|--no-update) export IMPORT=0;; -v|--verbose) export VERBOSE="$(($VERBOSE + 1))";; -t|--target) export TARGET="$2"; shift;; diff --git a/iop/scripts/genconfig_min.sh b/iop/scripts/genconfig_min.sh index 2de9ee7f1..882fce2d0 100644 --- a/iop/scripts/genconfig_min.sh +++ b/iop/scripts/genconfig_min.sh @@ -2,6 +2,7 @@ function genconfig_min { export CLEAN=0 + export DIRTY="--dirty" export SRCTREEOVERR=0 export FILEDIR="files/" CURRENT_CONFIG_FILE=".current_config_file" @@ -197,6 +198,7 @@ function genconfig_min { echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]" echo echo -e " -c|--clean\t\tRemove all files under ./files and import from config " + echo -e " -D|--no-dirty\t\tIgnore dirty tree" echo -e " -v|--verbose\t\tVerbose" echo -e " -n|--no-update\tDo NOT! Update customer config before applying" echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from" @@ -390,7 +392,7 @@ function genconfig_min { # Set target version local git_version - if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then + if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then echo "ERROR: Failed getting version via git describe, exiting." >&2 return 1 fi @@ -451,6 +453,7 @@ function genconfig_min { case "$1" in -c|--clean) export CLEAN=1;; + -D|--no-dirty) export DIRTY="";; -n|--no-update) export IMPORT=0;; -v|--verbose) export VERBOSE="$(($VERBOSE + 1))";; -t|--target) export TARGET="$2"; shift;;