-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbump-kernels
More file actions
executable file
·82 lines (69 loc) · 1.83 KB
/
bump-kernels
File metadata and controls
executable file
·82 lines (69 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
# bump dist-kernels
# (c) 2022-2026 Michał Górny <mgorny@gentoo.org>
# SPDX-License-Identifier: GPL-2.0-or-later
set -x -e
shopt -s extglob
scriptdir=${BASH_SOURCE%/*}
cd "$(git rev-parse --show-toplevel)"
NEWEST_GENTOO_CONFIG_P=$(
grep -h "^GENTOO_CONFIG_P=" sys-kernel/{gentoo,vanilla}-kernel/*.ebuild |
sort -V | tail -n 1
)
if [[ ${#} -eq 0 ]]; then
set -- $("${scriptdir}"/get-kernel-slots)
fi
for arg; do
if [[ ${arg} == *:* ]]; then
old_full=${arg%:*}
new_full=${arg#*:}
else
old_full=${arg}*
new_full=+1
fi
for pkg in vanilla-kernel gentoo-kernel; do
old=${old_full}
new=${new_full}
if [[ ${pkg} == vanilla-kernel ]]; then
old=${old%_p*}
new=${new%_p*}
fi
[[ ${old} == ${new} ]] && continue
(
cd sys-kernel/${pkg}
oldk=${pkg}-${old}.ebuild
newk=${new}
if [[ ${newk} != +* ]]; then
newk=${pkg}-${newk}.ebuild
fi
"${scriptdir}"/pkgbump -M -D "${oldk}" "${newk}"
if [[ ${newk} == +* ]]; then
newk=${pkg}-$(<.pkgbump-pv).ebuild
fi
[[ ${old_full%_p*} != ${new_full%_p*} ]] &&
sed -i -e "s:^\(SHA256SUM_DATE=\).*:\1$(date +%Y%m%d):" "${newk}"
sed -i -e "s:^GENTOO_CONFIG_P=.*$:${NEWEST_GENTOO_CONFIG_P}:" "${newk}"
${EDITOR:-vim} "${newk}"
GENTOO_MIRRORS= ebuild "${newk}" manifest
if [[ ${pkg} != vanilla-kernel ]]; then
# do verify-sig & test patching
USE="experimental verify-sig" ebuild "${newk}" prepare
ebuild "${newk}" clean &
fi
git add Manifest "${newk}"
"${scriptdir}"/pkgcommit -sS . --bump
)
done
(
pkg=dist-kernel
cd "virtual/${pkg}"
oldk=${pkg}-${old_full}.ebuild
newk=${new_full}
if [[ ${newk} != +* ]]; then
newk=${pkg}-${newk}.ebuild
fi
"${scriptdir}"/pkgbump -M -D -c "${oldk}" "${newk}"
)
git diff origin > ${BINPKG_DOCKER:-~/git/binpkg-docker}/local.diff
done
while wait -n; do :; done