Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-catalyst] [PATCH 15/37] targets: Use pkgcache for kernel sources
Date: Wed, 21 Oct 2020 00:24:23
Message-Id: 20201021002344.378131-15-mattst88@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 01/37] catalyst: Use early return to unindent code by Matt Turner
1 The rationale for not using it before made sense, given that multiple
2 binpkgs could not exist for the same version of a package. But we now
3 use FEATURES=binpkg-multi-instance so this is no longer the case.
4
5 The dumbest part of this is that the code wasn't even disabling the
6 package cache. It was instead just overriding PKGDIR to dump the binary
7 package into a location (named "ebuilds" no less!) that emerge would
8 never otherwise use.
9
10 Signed-off-by: Matt Turner <mattst88@g.o>
11 ---
12 targets/support/kmerge.sh | 13 ++-----------
13 1 file changed, 2 insertions(+), 11 deletions(-)
14
15 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
16 index 15a21b90..aec4d71e 100755
17 --- a/targets/support/kmerge.sh
18 +++ b/targets/support/kmerge.sh
19 @@ -3,7 +3,6 @@
20 source /tmp/chroot-functions.sh
21
22 install -d /tmp/kerncache
23 -PKGDIR=/tmp/kerncache/${kname}/ebuilds
24
25 setup_gk_args() {
26 # default genkernel args
27 @@ -85,7 +84,6 @@ genkernel_compile(){
28 else
29 gk_callback_opts=(-qN)
30 fi
31 - PKGDIR=${PKGDIR}
32 if [ -n "${clst_KERNCACHE}" ]
33 then
34 gk_callback_opts+=(-kb)
35 @@ -126,11 +124,6 @@ then
36 ksource="virtual/linux-sources"
37 fi
38
39 -# Don't use pkgcache here, as the kernel source may get emerged with different
40 -# USE variables (and thus different patches enabled/disabled.) Also, there's no
41 -# real benefit in using the pkgcache for kernel source ebuilds.
42 -
43 -
44 # Check if we have a match in kerncach
45
46 if [ -n "${clst_KERNCACHE}" ]
47 @@ -145,8 +138,6 @@ then
48 then
49 USE_MATCH=1
50 else
51 - [ -d /tmp/kerncache/${kname}/ebuilds ] && \
52 - rm -r /tmp/kerncache/${kname}/ebuilds
53 [ -e /tmp/kerncache/${kname}/usr/src/linux/.config ] && \
54 rm /tmp/kerncache/${kname}/usr/src/linux/.config
55 fi
56 @@ -181,7 +172,7 @@ then
57
58 # install dependencies of kernel sources ahead of time in case
59 # package.provided generated below causes them not to be (re)installed
60 - PKGDIR=${PKGDIR} run_merge --onlydeps "${ksource}"
61 + run_merge --onlydeps "${ksource}"
62
63 # Create the kerncache directory if it doesn't exists
64 mkdir -p /tmp/kerncache/${kname}
65 @@ -205,7 +196,7 @@ then
66
67 [ -L /usr/src/linux ] && rm -f /usr/src/linux
68
69 - PKGDIR=${PKGDIR} run_merge "${ksource}"
70 + run_merge "${ksource}"
71
72 SOURCESDIR="/tmp/kerncache/${kname}/sources"
73 if [ -L /usr/src/linux ]
74 --
75 2.26.2