Skip to content

Commit 76e02c0

Browse files
arjav1528acassis
authored andcommitted
netutils/cjson: update cJSON download URL format
Modified CMakeLists.txt, Kconfig, and Makefile to change the cJSON download URL to include 'refs/tags/' for proper version fetching. This ensures compatibility with GitHub's archive download requirements. Signed-off-by: Arjav Patel <arjav1528@gmail.com>
1 parent 1ab486d commit 76e02c0

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

netutils/cjson/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
if(CONFIG_NETUTILS_CJSON)
2424

2525
if(NOT CONFIG_NETUTILS_CJSON_URL)
26-
set(CONFIG_NETUTILS_CJSON_URL "https://github.com/DaveGamble/cJSON/archive")
26+
set(CONFIG_NETUTILS_CJSON_URL
27+
"https://github.com/DaveGamble/cJSON/archive/refs/tags")
2728
endif()
2829

2930
if(NOT CONFIG_NETUTILS_CJSON_VERSION)
3031
set(CONFIG_NETUTILS_CJSON_VERSION "1.7.10")
3132
endif()
3233

33-
# GitHub requires refs/tags/ in the archive URL for tag downloads
3434
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/cJSON)
3535
FetchContent_Declare(
3636
cJSON
3737
DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
3838
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
39-
URL "${CONFIG_NETUTILS_CJSON_URL}/refs/tags/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
39+
URL "${CONFIG_NETUTILS_CJSON_URL}/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
4040
SOURCE_DIR
4141
${CMAKE_CURRENT_LIST_DIR}/cJSON
4242
BINARY_DIR

netutils/cjson/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if NETUTILS_CJSON
1414

1515
config NETUTILS_CJSON_URL
1616
string "URL where cJSON library can be downloaded"
17-
default "https://github.com/DaveGamble/cJSON/archive"
17+
default "https://github.com/DaveGamble/cJSON/archive/refs/tags"
1818

1919
config NETUTILS_CJSON_VERSION
2020
string "Version number"

netutils/cjson/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ include $(APPDIR)/Make.defs
2828

2929
WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
3030

31-
CONFIG_NETUTILS_CJSON_URL ?= "https://github.com/DaveGamble/cJSON/archive"
31+
CONFIG_NETUTILS_CJSON_URL ?= "https://github.com/DaveGamble/cJSON/archive/refs/tags"
3232
CONFIG_NETUTILS_CJSON_VERSION ?= "1.7.10"
3333
CJSON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_NETUTILS_CJSON_VERSION)))
3434

@@ -49,12 +49,10 @@ 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)
5452
ifeq ($(wildcard $(CJSON_UNPACKNAME)/.git),)
5553
$(CJSON_TARBALL):
5654
@echo "Downloading: $(CJSON_TARBALL)"
57-
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/refs/tags/$(CJSON_TARBALL)
55+
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL)
5856

5957
$(CJSON_UNPACKNAME): $(CJSON_TARBALL)
6058
@echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"

0 commit comments

Comments
 (0)