]> git.plutz.net Git - blast/blob - modules/approx.mk
e221b0381c0cc18a393b1c3a5b6bab0c0959f7e5
[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   deb ${approx} ${release}-backports ${approxrepos}
19   endef
20 else ifdef raspi
21   BOOTSTRAP := http://localhost/raspbian
22   define SOURCES :=
23   deb http://${approxhost}/raspbian  stretch main non-free firmware rpi
24   deb http://${approxhost}/rpidebian stretch main
25   deb http://${approxhost}/raspbian  buster main non-free firmware rpi
26   deb http://${approxhost}/rpidebian buster main
27   endef
28 else
29   BOOTSTRAP := http://localhost/debian
30   define SOURCES :=
31   deb http://${approxhost}/debian ${release} ${approxrepos}
32   endef
33 endif
34
35 .PHONY: _approx_restore_sources
36 _config: _approx_restore_sources
37 _approx_restore_sources: ${CFGROOT}
38         printf '%s\n' "$${approx_original_sources}" >"$${CFGROOT}/etc/apt/sources.list"
39         -chroot "$${CFGROOT}" apt-get update