Skip to content

Commit 13f44cc

Browse files
committed
REVYOS: HACK: using the major version number as package name
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
1 parent bfa6c8c commit 13f44cc

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

scripts/package/mkdebian

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,27 @@ echo $debarch > debian/arch
181181

182182
host_gnu=$(dpkg-architecture -a "${debarch}" -q DEB_HOST_GNU_TYPE | sed 's/_/-/g')
183183

184+
# A.B.CDE -> A.BE
185+
# 1. Extract the A.B part
186+
# Uses sed with extended regex (POSIX standard)
187+
PARSED_AB=$(echo "${KERNELRELEASE}" | sed -E 's/^([0-9]+\.[0-9]+)\..*$/\1/')
188+
189+
# 2. Extract the E part
190+
# This sed chain removes A.B.C and optional -rcX parts,
191+
# leaving only the 'E' portion (which might be empty or start with a hyphen).
192+
E_PART=$(echo "${KERNELRELEASE}" | sed -E '
193+
s/^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?(.*)$/\2/;
194+
/^-rc[0-9]+$/d; # If only "-rcX" remains, delete it (meaning E is empty)
195+
')
196+
197+
# 3. Combine A.B and E
198+
# Check if E_PART is not empty. If it's not, append it to A.B.
199+
if [ -n "${E_PART}" ]; then
200+
PACKAGENAMEVERSION="${PARSED_AB}${E_PART}"
201+
else
202+
PACKAGENAMEVERSION="${PARSED_AB}"
203+
fi
204+
184205
# Generate a simple changelog template
185206
cat <<EOF > debian/changelog
186207
$sourcename ($packageversion) $distribution; urgency=low
@@ -205,7 +226,7 @@ Build-Depends-Arch: bc, bison, cpio, flex,
205226
python3:native, rsync
206227
Homepage: https://www.kernel.org/
207228
208-
Package: $packagename-$version
229+
Package: $packagename-${PACKAGENAMEVERSION}
209230
Architecture: $debarch
210231
Provides: wireguard-modules (= 1.0.0)
211232
Depends: u-boot-fdtdir-dtb
@@ -230,7 +251,7 @@ EOF
230251
if is_enabled CONFIG_MODULES; then
231252
cat <<EOF >> debian/control
232253
233-
Package: linux-headers-$version
254+
Package: linux-headers-${PACKAGENAMEVERSION}
234255
Architecture: $debarch
235256
Build-Profiles: <!pkg.${sourcename}.nokernelheaders>
236257
Description: Linux kernel headers for $version on $debarch
@@ -244,7 +265,7 @@ fi
244265
if is_enabled CONFIG_DEBUG_INFO; then
245266
cat <<EOF >> debian/control
246267
247-
Package: linux-image-$version-dbg
268+
Package: linux-image-${PACKAGENAMEVERSION}-dbg
248269
Section: debug
249270
Architecture: $debarch
250271
Build-Profiles: <!pkg.${sourcename}.nokerneldbg>

0 commit comments

Comments
 (0)