source: trunk/debian/rootfs/debootstrap.mk @ 869

Last change on this file since 869 was 869, checked in by amain, 3 years ago

rootfs: use latest bootstrap (mainly for sid/stretch which keeps changing). Not adding kexec-tools to all debian releases (wheezy does not have it).

File size: 1.0 KB
Line 
1debian/rootfs/debootstrap-download:
2        @rm -rf $(TMP_DIR)/debootstrap*.deb
3        @wget -q -O - https://packages.debian.org/sid/all/debootstrap/download \
4          | grep ftp.nl.debian.org \
5          | sed 's/.*\(http.*\)".*/\1/' \
6          | ( read url; \
7              latest=$$(basename $${url}); \
8              echo -n "Downloading latest debootstrap $${latest} to $(TMP_DIR)..."; \
9              wget -qP $(TMP_DIR) $${url}; \
10              [ $$? -eq 0 ] && echo "done" || echo "fail"; \
11            )
12        touch $@
13
14debian/rootfs/debootstrap-install: debian/rootfs/debootstrap-download
15        @( installed=$$(dpkg-query --showformat='$${Version}' --show debootstrap); \
16          latestf=$$(ls $(TMP_DIR)/debootstrap*.deb); \
17          latest=$${latestf#*_}; \
18          latest=$${latest%_*}; \
19          echo "Debootstrap latest   : $${latest}"; \
20          echo "Debootstrap installed: $${installed}"; \
21          if dpkg --compare-versions "$${latest}" "gt" "$${installed}"; \
22          then \
23             echo "Installing latest debootstrap..."; \
24             sudo dpkg -i $${latestf}; \
25          else \
26             echo "Latest debootstrap already installed." ;\
27          fi \
28        )
29
Note: See TracBrowser for help on using the repository browser.