From f892939039073825f0917198a7972f57b85f2112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 1 May 2017 13:01:04 +0200 Subject: linux: run postinst only once of it was already added --- sys-kernel/linux/linux-4.10.13.ebuild | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys-kernel/linux/linux-4.10.13.ebuild b/sys-kernel/linux/linux-4.10.13.ebuild index ad38a3f..f9d648b 100644 --- a/sys-kernel/linux/linux-4.10.13.ebuild +++ b/sys-kernel/linux/linux-4.10.13.ebuild @@ -32,8 +32,10 @@ src_install() { } src_postinst() { - # Add label to syslinux config - sed -i "/^## Dynamic labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo${PV}\n\tLINUX ../bzlinux-${PV}\n\tAPPEND root=/dev/sda2 rootflags=subvol=@gentoo\n\tINITRD ../initramfs-gentoo\n" /boot/syslinux/syslinux.cfg || eerror "Adding label to syslinux configuration failed!" + # Add label to syslinux config if there is non yet + if ! grep -q "^LABEL gentoo-${PV}$" /boot/syslinux/syslinux.cfg; then + sed -i "/^## Dynamic labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo${PV}\n\tLINUX ../bzlinux-${PV}\n\tAPPEND root=/dev/sda2 rootflags=subvol=@gentoo\n\tINITRD ../initramfs-gentoo\n" /boot/syslinux/syslinux.cfg || eerror "Adding label to syslinux configuration failed!" + fi } src_prerm() { -- cgit v1.2.3