iop: genconfig: add option for ignoring dirty tree

Add -D option which ignores dirty tree when determining version.
This commit is contained in:
Erik Karlsson 2023-11-09 20:31:12 +01:00 committed by Andreas Gnau
parent 792e3ad20d
commit 0a755e5ea5
2 changed files with 8 additions and 2 deletions

View file

@ -2,6 +2,7 @@
function genconfig { function genconfig {
export CLEAN=0 export CLEAN=0
export DIRTY="--dirty"
export IMPORT=1 export IMPORT=1
export SRCTREEOVERR=0 export SRCTREEOVERR=0
export FILEDIR="files/" export FILEDIR="files/"
@ -198,6 +199,7 @@ function genconfig {
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]" echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo echo
echo -e " -c|--clean\t\tRemove all files under ./files and import from config " 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 " -v|--verbose\t\tVerbose"
echo -e " -n|--no-update\tDo NOT! Update customer config before applying" 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" 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 # Set target version
local git_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 echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1 return 1
fi fi
@ -483,6 +485,7 @@ function genconfig {
case "$1" in case "$1" in
-c|--clean) export CLEAN=1;; -c|--clean) export CLEAN=1;;
-D|--no-dirty) export DIRTY="";;
-n|--no-update) export IMPORT=0;; -n|--no-update) export IMPORT=0;;
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";; -v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
-t|--target) export TARGET="$2"; shift;; -t|--target) export TARGET="$2"; shift;;

View file

@ -2,6 +2,7 @@
function genconfig_min { function genconfig_min {
export CLEAN=0 export CLEAN=0
export DIRTY="--dirty"
export SRCTREEOVERR=0 export SRCTREEOVERR=0
export FILEDIR="files/" export FILEDIR="files/"
CURRENT_CONFIG_FILE=".current_config_file" CURRENT_CONFIG_FILE=".current_config_file"
@ -197,6 +198,7 @@ function genconfig_min {
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]" echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo echo
echo -e " -c|--clean\t\tRemove all files under ./files and import from config " 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 " -v|--verbose\t\tVerbose"
echo -e " -n|--no-update\tDo NOT! Update customer config before applying" 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" 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 # Set target version
local git_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 echo "ERROR: Failed getting version via git describe, exiting." >&2
return 1 return 1
fi fi
@ -451,6 +453,7 @@ function genconfig_min {
case "$1" in case "$1" in
-c|--clean) export CLEAN=1;; -c|--clean) export CLEAN=1;;
-D|--no-dirty) export DIRTY="";;
-n|--no-update) export IMPORT=0;; -n|--no-update) export IMPORT=0;;
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";; -v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
-t|--target) export TARGET="$2"; shift;; -t|--target) export TARGET="$2"; shift;;