]> git.plutz.net Git - blast/blob - modules/approx.mk
f7541d7d231d3cde159a4882e0101d9a4d4240d8
[blast] / modules / approx.mk
1 define approx_original_sources :=
2 ${SOURCES}
3 endef
4 export approx_original_sources
5
6 ifndef approxhost
7   approxhost := localhost
8 endif
9
10 approxrepos := main
11 approxrepos += $(findstring contrib, ${SOURCES})
12 approxrepos += $(findstring non-free, ${SOURCES})
13
14 ifdef approx
15   BOOTSTRAP := ${approx}
16   define SOURCES =
17   deb ${approx} ${release} ${approxrepos}
18   endef
19 else ifdef raspi
20   BOOTSTRAP := http://localhost/raspbian
21   define SOURCES :=
22   deb http://${approxhost}/raspbian  stretch main non-free firmware rpi
23   deb http://${approxhost}/rpidebian stretch main
24   deb http://${approxhost}/raspbian  buster main non-free firmware rpi
25   deb http://${approxhost}/rpidebian buster main
26   endef
27 else
28   BOOTSTRAP := http://localhost/debian
29   define SOURCES :=
30   deb http://${approxhost}/debian ${release} ${approxrepos}
31   endef
32 endif
33
34 .PHONY: _approx_restore_sources
35 _config: _approx_restore_sources
36 _approx_restore_sources: ${CFGROOT}
37         printf '%s\n' "$${approx_original_sources}" >"$${CFGROOT}/etc/apt/sources.list"
38         -chroot "$${CFGROOT}" apt-get update