aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2024-03-06 12:23:41 +0100
committerRobert Alessi <alessi@robertalessi.net>2024-03-06 12:23:41 +0100
commitbe39ec164daa140255acd4840fe4231e14d3b6d3 (patch)
treeee873f8ac0e9c84a51b0078b3bc2dc2f2030e586
parent875186950e07e898dad5cc97a811a91104a8c559 (diff)
downloadtexlive-openbsd-be39ec164daa140255acd4840fe4231e14d3b6d3.tar.gz
makefile: check for forbidden dirs
-rw-r--r--makefile35
1 files changed, 28 insertions, 7 deletions
diff --git a/makefile b/makefile
index bf37f4b..b127cfe 100644
--- a/makefile
+++ b/makefile
@@ -7,6 +7,9 @@ TLBINPATH!=which latex | sed 's/\/latex//'
7TMPSOURCE?="" 7TMPSOURCE?=""
8UPDATING!=curl -s ${BINREPO}/status.txt | grep updating= | sed 's/.*=//' 8UPDATING!=curl -s ${BINREPO}/status.txt | grep updating= | sed 's/.*=//'
9 9
10DONT_TOUCH_DIRS:=${HOME}/bin /bin /sbin /usr/bin /usr/sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin
11
12
10.MAIN: update 13.MAIN: update
11 14
12fetch: 15fetch:
@@ -14,9 +17,9 @@ fetch:
14 @echo "The binaries are being updated. Please re-run this command later." 17 @echo "The binaries are being updated. Please re-run this command later."
15.else 18.else
16 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz \ 19 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz \
17 > ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz 20 -o ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz
18 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc \ 21 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc \
19 > ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc 22 -o ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc
20 gpg --verify ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc 23 gpg --verify ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc
21 unxz ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz 24 unxz ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz
22 mkdir ${TMPDIR}/bin \ 25 mkdir ${TMPDIR}/bin \
@@ -33,11 +36,22 @@ update:
33 @echo "The binaries are being updated. Please re-run this command later." 36 @echo "The binaries are being updated. Please re-run this command later."
34.else 37.else
35 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz \ 38 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz \
36 > ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz 39 -o ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz
37 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc \ 40 curl ${BINREPO}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc \
38 > ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc 41 -o ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc
39 gpg --verify ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc 42 gpg --verify ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz.asc
43.for DIR in ${DONT_TOUCH_DIRS}
44.if "${DIR}" == ${TLBINPATH}
45 @echo ""
46 @echo "This program will never affect a system directory such as ${TLBINPATH}"
47 @echo "To complete the update, you must replace by hand your binaries"
48 @echo "with those in ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz"
49 @echo "Exiting now."
50 exit 1
51.endif
52.endfor
40.if "${PREFIX}" == ${TLBINPATH} 53.if "${PREFIX}" == ${TLBINPATH}
54 @echo ""
41 @echo "Looks good." 55 @echo "Looks good."
42 @echo "Now do this to update the binaries:" 56 @echo "Now do this to update the binaries:"
43 @echo "1. Remove the binaries that are currently installed:" 57 @echo "1. Remove the binaries that are currently installed:"
@@ -45,10 +59,17 @@ update:
45 @echo "2. Run this command:" 59 @echo "2. Run this command:"
46 @echo " make TMPSOURCE=${TMPDIR} install" 60 @echo " make TMPSOURCE=${TMPDIR} install"
47.else 61.else
62 @echo ""
48 @echo "Looks like your TL binaries are in ${TLBINPATH}" 63 @echo "Looks like your TL binaries are in ${TLBINPATH}"
49 @echo "instead of ${PREFIX}" 64 @echo "instead of the expected ${PREFIX}."
50 @echo "To complete the update, you must replace by hand your binaries" 65 @echo "To complete the update, you must remove by hand your binaries."
51 @echo "with those in ${TMPDIR}/amd64-openbsd${OPENBSD_VERSION}.tar.xz" 66 @echo "******************************************************************************"
67 @echo "* CAUTION: You must first ensure that ${TLBINPATH} contains nothing"
68 @echo "* but the TeX Live binaries, otherwise you may damage your system permanently."
69 @echo "******************************************************************************"
70 @echo "Then do:"
71 @echo "1. doas rm ${TLBINPATH}/*"
72 @echo "2. make TMPSOURCE=${TMPDIR} PREFIX=${TLBINPATH} install"
52.endif 73.endif
53.endif 74.endif
54 75