summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorVolker Grabsch <v@njh.eu>2013-07-21 21:26:40 (GMT)
committerVolker Grabsch <v@njh.eu>2013-07-21 23:41:31 (GMT)
commite412eb642da53cdfc2368729a3b177153f307aa3 (patch)
treed8b5613204114e37b628b3399cf1d0bf246000c2 /Makefile
parent4419187a6888a8ad95cf4d8e07f501302e7fe912 (diff)
downloadmxe-e412eb642da53cdfc2368729a3b177153f307aa3.zip
mxe-e412eb642da53cdfc2368729a3b177153f307aa3.tar.gz
mxe-e412eb642da53cdfc2368729a3b177153f307aa3.tar.bz2
Move package versions from index.html back into the src/*.mk files
Most of the automatic conversion was done using the following Python script: import os import re pkgs = sorted(mkfile[:-len('.mk')] for mkfile in os.listdir('src') if mkfile.endswith('.mk')) with open('index.html', 'rb') as f: index = f.read() pkgs_index = re.findall('<td class="package">([^<]*)</td>', index) assert pkgs_index == pkgs versions = dict(re.findall('<td id="([^"]*)-version">([^<]*)</td>', index)) assert sorted(versions.keys()) == pkgs for pkg in pkgs: version = versions[pkg] with open('src/' + pkg + '.mk', 'rb') as f: mk = f.read() checksumpos = mk.index('\n$(PKG)_CHECKSUM ') versionline = '\n$(PKG)_VERSION := %(version)s' % {'version': version} newmk = mk[:checksumpos] + versionline + mk[checksumpos:] with open('src/' + pkg + '.mk', 'wb') as f: f.write(newmk)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 2 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 57e64bd..fda0965 100644
--- a/Makefile
+++ b/Makefile
@@ -142,11 +142,6 @@ define newline
endef
-$(eval $(subst #,$(newline),$(shell \
- $(SED) -n \
- 's/^.* id="\([A-Za-z0-9_+-]*\)-version">\([^<]*\)<.*$$/\1_VERSION := \2#/p' \
- '$(TOP_DIR)/index.html' \
-)))
include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS))
@@ -284,9 +279,9 @@ define UPDATE
$(info . $(1) $(2)),
$(info OLD $(1) $($(1)_VERSION) --> $(2) ignoring)),
$(info NEW $(1) $($(1)_VERSION) --> $(2))
- $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$(2)/' '$(TOP_DIR)/index.html'
+ $(SED) -i 's/^\([^ ]*_VERSION *:=\).*/\1 $(2)/' '$(TOP_DIR)/src/$(1).mk'
$(MAKE) -f '$(MAKEFILE)' 'update-checksum-$(1)' \
- || { $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$($(1)_VERSION)/' '$(TOP_DIR)/index.html'; \
+ || { $(SED) -i 's/^\([^ ]*_VERSION *:=\).*/\1 $($(1)_VERSION)/' '$(TOP_DIR)/src/$(1).mk'; \
exit 1; })),
$(info Unable to update version number of package $(1) \
$(newline)$(newline)$($(1)_UPDATE)$(newline)))