mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
build system: Also get IDF version from annotated tags only
Builds on previous commit. Note: Getting the project version still pases --tags so still works with plain tags, to keep compatibility for existing projects
This commit is contained in:
@@ -196,7 +196,7 @@ def get_version():
|
|||||||
"""
|
"""
|
||||||
# Use git to look for a tag
|
# Use git to look for a tag
|
||||||
try:
|
try:
|
||||||
tag = subprocess.check_output(["git", "describe", "--tags", "--exact-match"]).strip().decode('utf-8')
|
tag = subprocess.check_output(["git", "describe", "--exact-match"]).strip().decode('utf-8')
|
||||||
is_stable = re.match(r"v[0-9\.]+$", tag) is not None
|
is_stable = re.match(r"v[0-9\.]+$", tag) is not None
|
||||||
return (tag, "tag", is_stable)
|
return (tag, "tag", is_stable)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
@@ -338,7 +338,7 @@ endif
|
|||||||
|
|
||||||
# If we have `version.txt` then prefer that for extracting IDF version
|
# If we have `version.txt` then prefer that for extracting IDF version
|
||||||
ifeq ("$(wildcard ${IDF_PATH}/version.txt)","")
|
ifeq ("$(wildcard ${IDF_PATH}/version.txt)","")
|
||||||
IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --tags --dirty)
|
IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --dirty)
|
||||||
else
|
else
|
||||||
IDF_VER_T := $(shell cat ${IDF_PATH}/version.txt)
|
IDF_VER_T := $(shell cat ${IDF_PATH}/version.txt)
|
||||||
endif
|
endif
|
||||||
|
@@ -857,7 +857,7 @@ def get_python_env_path():
|
|||||||
idf_version_str = version_file.read()
|
idf_version_str = version_file.read()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
idf_version_str = subprocess.check_output(['git', 'describe', '--tags'],
|
idf_version_str = subprocess.check_output(['git', 'describe'],
|
||||||
cwd=global_idf_path, env=os.environ).decode()
|
cwd=global_idf_path, env=os.environ).decode()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
warn('Git describe was unsuccessul: {}'.format(e))
|
warn('Git describe was unsuccessul: {}'.format(e))
|
||||||
|
Reference in New Issue
Block a user