Skip to content

Commit d49307d

Browse files
committed
netutils/cjson: update download URL for cJSON tarball to include refs/tags
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
1 parent d48b450 commit d49307d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

netutils/cjson/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ if(CONFIG_NETUTILS_CJSON)
3030
set(CONFIG_NETUTILS_CJSON_VERSION "1.7.10")
3131
endif()
3232

33+
# GitHub requires refs/tags/ in the archive URL for tag downloads
3334
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/cJSON)
3435
FetchContent_Declare(
3536
cJSON
3637
DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
3738
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
38-
URL "${CONFIG_NETUTILS_CJSON_URL}/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
39+
URL "${CONFIG_NETUTILS_CJSON_URL}/refs/tags/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
3940
SOURCE_DIR
4041
${CMAKE_CURRENT_LIST_DIR}/cJSON
4142
BINARY_DIR

netutils/cjson/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c
4949
CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c
5050

5151
# Download and unpack tarball if no git repo found
52+
# GitHub requires refs/tags/ in the archive URL for tag downloads (see
53+
# https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives)
5254
ifeq ($(wildcard $(CJSON_UNPACKNAME)/.git),)
5355
$(CJSON_TARBALL):
5456
@echo "Downloading: $(CJSON_TARBALL)"
55-
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL)
57+
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/refs/tags/$(CJSON_TARBALL)
5658

5759
$(CJSON_UNPACKNAME): $(CJSON_TARBALL)
5860
@echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"

0 commit comments

Comments
 (0)