Skip to content

Commit eb7ffee

Browse files
committed
generate correct github URLs for release files including the core version directory
1 parent 954bcbe commit eb7ffee

File tree

5 files changed

+42
-32
lines changed

5 files changed

+42
-32
lines changed

board-manager/Makefile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,38 @@ SDCCVERSION=10088
44
TOOLSVERSION=2017.11.06
55

66
BASEURL=https://github.com/tenbaht/sduino/releases/download/v$(COREVERSION)
7+
78
PACKAGEFILE=package_sduino_stm8_index.json
89

10+
# version for pre-release testing on my private server at home
11+
TESTPACKAGEFILE=package_testserver_index.json
12+
TESTBASEURL=http://knecht.fritz.box/sduino/release
13+
TESTBASEDIR=knecht:/var/www/html/sduino
14+
915
export
1016

1117
.PHONY: core tools sdcc clean upload release
1218

1319

14-
$(PACKAGEFILE): core tools sdcc
20+
$(TESTPACKAGEFILE): ../$(PACKAGEFILE)
21+
sed 's#http.*/download/#$(TESTBASEURL)/#' $^ > $@
22+
23+
../$(PACKAGEFILE): core tools sdcc
1524
@echo "Generating the package_index file."
1625
./assemble.sh $@
1726

18-
../$(PACKAGEFILE): $(PACKAGEFILE)
19-
sed 's#file:///.*/release/#$(BASEURL)/#' $^ > $@
20-
21-
core:
22-
VERSION=$(COREVERSION) make -f Makefile.core
23-
24-
tools:
25-
VERSION=$(TOOLSVERSION) make -f Makefile.tools
26-
27-
sdcc:
28-
VERSION=$(SDCCVERSION) make -f Makefile.sdcc
27+
core tools sdcc:
28+
make -f Makefile.$@
2929

3030
clean:
3131
rm -rf *~ *.jsone *.bak *.orig *.rej
3232

3333

3434
# upload to my private test server, totally useless for anybody else.
35-
upload: $(PACKAGEFILE)
36-
sed 's#file:///home/mmayer/rsync/stm8/board-manager#http://knecht.fritz.box/sduino#' $^ > package_knecht_index.json
37-
rsync -av -rsh=ssh --delete release package_knecht_index.json knecht:/var/www/html/sduino
35+
upload: $(TESTPACKAGEFILE)
36+
@echo "uploading to $(TESTBASEDIR)"
37+
rsync -av -rsh=ssh --delete release $(TESTPACKAGEFILE) $(TESTBASEDIR)
38+
@echo "URL for board manager: $(TESTBASEURL)/$(TESTPACKAGEFILE)"
3839

3940
DATE=$(shell date '+%F')
4041

board-manager/Makefile.core

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME=sduino
2-
VERSION?=0.3.2
2+
COREVERSION?=0.3.2
33
SDCCVERSION?=10088
44
TOOLSVERSION?=2017.11.06
55

@@ -15,10 +15,10 @@ SUBTREE=sduino/hardware/sduino/stm8
1515
#
1616

1717
# filename for the generated core file
18-
COREFILE=$(COREDIR)/$(NAME)-core-$(VERSION).tar.bz2
18+
COREFILE=$(COREDIR)/$(NAME)-core-$(COREVERSION).tar.bz2
1919

2020
# filename for the new platform entry
21-
PLATFORM_ENTRY=$(PARTSDIR)/platform-entry-$(NAME)-$(VERSION).txt
21+
PLATFORM_ENTRY=$(PARTSDIR)/platform-entry-$(NAME)-$(COREVERSION).txt
2222

2323
EXCLUDES=$(addprefix --exclude=, $(IGNORE))
2424

@@ -28,7 +28,8 @@ EXCLUDES=$(addprefix --exclude=, $(IGNORE))
2828

2929
# generate one platform entry for the new core file
3030
$(PLATFORM_ENTRY): $(COREFILE)
31-
./gen_platform_entry.sh $^ "$(VERSION)" "$(SDCCVERSION)" "$(TOOLSVERSION)" > $@
31+
./gen_platform_entry.sh $^ "$(COREVERSION)" "$(SDCCVERSION)" "$(TOOLSVERSION)" |\
32+
sed "s/^/ /" > $@
3233

3334
$(COREFILE):
3435
echo "Generating the core archive file."

board-manager/Makefile.sdcc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
NAME=sdcc
2-
VERSION?=10088
2+
COREVERSION?=0.3.0
3+
SDCCVERSION?=10088
34

45
# where to look for the original SDCC snapshot files
56
#SNAPSHOTDIR=sdcc-snapshots
@@ -8,6 +9,7 @@ VERSION?=10088
89
SDCCDIR=release
910
PARTSDIR=parts
1011

12+
VERSION=$(SDCCVERSION)
1113

1214
#
1315
### No user serviceable part below here. Only generated content. ########
@@ -25,4 +27,4 @@ TOOLS_ENTRY=$(PARTSDIR)/tools-entry-$(NAME)-$(VERSION).txt
2527

2628

2729
$(TOOLS_ENTRY) : $(SDCC_TARS)
28-
./gen_tools_entry.sh "$(TOOLS_STEM)" "$(VERSION)" > $@
30+
./gen_tools_entry.sh "$(TOOLS_STEM)" "$(VERSION)" "$(COREVERSION)" > $@

board-manager/Makefile.tools

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME=sduino-tools
2-
VERSION?=2017.10.21
2+
TOOLSVERSION?=2017.10.21
33

44
# Where to find the tools directory
55
BASEDIR=../sduino/hardware/sduino
@@ -21,12 +21,12 @@ PARTSDIR=parts
2121
TOOLS_STEM=$(ARCHIVEDIR)/$(NAME)
2222

2323
# filename for the new tools entries
24-
TOOLS_ENTRY=$(PARTSDIR)/tools-entry-$(NAME)-$(VERSION).txt
24+
TOOLS_ENTRY=$(PARTSDIR)/tools-entry-$(NAME)-$(TOOLSVERSION).txt
2525

2626
# The individual filenames for the different tools archives
27-
TOOLS_LINUX32=release/$(NAME)_linux32-$(VERSION).tar.bz2
28-
TOOLS_LINUX64=release/$(NAME)_linux64-$(VERSION).tar.bz2
29-
TOOLS_WINDOWS=release/$(NAME)_mingw32-$(VERSION).tar.bz2
27+
TOOLS_LINUX32=release/$(NAME)_linux32-$(TOOLSVERSION).tar.bz2
28+
TOOLS_LINUX64=release/$(NAME)_linux64-$(TOOLSVERSION).tar.bz2
29+
TOOLS_WINDOWS=release/$(NAME)_mingw32-$(TOOLSVERSION).tar.bz2
3030

3131
TOOLS_TARS=$(TOOLS_LINUX32) $(TOOLS_LINUX64) $(TOOLS_WINDOWS)
3232
EXCLUDES=$(addprefix --exclude=, $(IGNORE))
@@ -38,7 +38,7 @@ TARFLAGS=$(EXCLUDES) --show-transformed-names --transform
3838

3939
# generate one tools entry for all matching tools files
4040
$(TOOLS_ENTRY) : $(TOOLS_TARS)
41-
./gen_tools_entry.sh "$(TOOLS_STEM)" "$(VERSION)" > $@
41+
./gen_tools_entry.sh "$(TOOLS_STEM)" "$(TOOLSVERSION)" "$(COREVERSION)" > $@
4242

4343
$(TOOLS_LINUX32):
4444
@echo "Generating the tools archive file for Linux 32 bit."

board-manager/gen_tools_entry.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,34 @@
66
# package_*.json file.
77

88

9-
if [ $# -ne 2 ]; then
9+
if [ $# -ne 3 ]; then
1010
echo "
1111
helper script for automatic releases.
1212
1313
Prints a full tool entry for the given filename stem to be added to the
1414
package_*_index.json file. It will include all OS variants found with the
1515
same filename stem and the same version specifier.
1616
17-
usage: $0 toolfile-stem version
17+
usage: $0 toolfile-stem toolversion coreversion
1818
1919
Lists info for all files matching the filename pattern
2020
[toolsfile-stem]*[version]*
2121
22-
Example: $0 release/sduino-tools 2017-10-21 prints information for all files
23-
matching the filename pattern release/sduino-tools*2017-10-21*.
22+
The coreversion is only needed to build the download link.
23+
24+
Example: $0 release/sduino-tools 2017-10-21 0.3.1
25+
prints information for all files matching the filename pattern
26+
release/sduino-tools*2017-10-21* and generates download links
27+
for a github release directory download/v0.3.1.
2428
"
2529
exit 1
2630
fi
2731

2832
TRUNK=$1
2933
VERSION=$2
34+
COREVERSION=$3
3035

36+
BASEURL=https://github.com/tenbaht/sduino/releases/download/v${COREVERSION}
3137

3238
### helper functions #####################################################
3339

@@ -37,8 +43,8 @@ VERSION=$2
3743
#
3844
print_filedata()
3945
{
40-
URL=file://$(realpath $1)
4146
FILENAME=$(basename "$1")
47+
URL=${BASEURL}/${FILENAME}
4248
SIZE=$(stat --printf="%s" $1)
4349
CHKSUM=$(shasum -a 256 $1|cut "-d " -f1)
4450
cat << EOF

0 commit comments

Comments
 (0)