sys-apps/memtest86+: Update 39_memtest86+ to support grub submenus
authorNP-Hardass <NP-Hardass@gentoo.org>
Sat, 14 May 2016 22:40:28 +0000 (18:40 -0400)
committerNP-Hardass <NP-Hardass@gentoo.org>
Sun, 10 Jul 2016 02:48:23 +0000 (22:48 -0400)
Package-Manager: portage-2.2.28

sys-apps/memtest86+/files/39_memtest86+
sys-apps/memtest86+/memtest86+-4.20-r3.ebuild [moved from sys-apps/memtest86+/memtest86+-4.20-r2.ebuild with 97% similarity]
sys-apps/memtest86+/memtest86+-5.01-r2.ebuild [moved from sys-apps/memtest86+/memtest86+-5.01-r1.ebuild with 98% similarity]

index 14f27a2768889b236caf35f23f77d1a11d3770b0..10e1964cb8dfab40cba92b1c045b64199004c04a 100644 (file)
@@ -4,30 +4,67 @@
 
 memtest=/boot/memtest86plus/memtest
 
+memtestbsd=/boot/memtest86plus/memtest.netbsd
+
+if [ -f "${memtest}" ] && [ -f "${memtestbsd}" ]; then
+       multiple_memtest=true
+fi
+
+submenu_indentation=""
+if [ "x${multiple_memtest}" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
+       submenu_indentation="${grub_tab}"
+       cat <<EOF
+submenu 'Memtest86+' {
+EOF
+fi
+
+
 if [ -f "${memtest}" ]; then
+
+       gettext_printf "Found memtest image: %s\n" "${memtest}" >&2
+
        device="$("${grub_probe}" --target=device "${memtest}")"
        path="$(make_system_path_relative_to_its_root "${memtest}")"
        cat <<EOF
-menuentry "Memtest86+" {
+${submenu_indentation}menuentry 'Memtest86+' {
 EOF
-       prepare_grub_to_access_device "${device}" | grub_add_tab
+
+       if [ "x${submenu_indentation}" != "x" ]; then
+               prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+       else
+               prepare_grub_to_access_device "${device}" | grub_add_tab
+       fi
+
        cat <<EOF
-       linux16 "${path}"
-}
+       ${submenu_indentation}linux16 "${path}"
+${submenu_indentation}}
 EOF
 fi
 
-memtest=/boot/memtest86plus/memtest.netbsd
+if [ -f "${memtestbsd}" ]; then
 
-if [ -f "${memtest}" ]; then
-       device="$("${grub_probe}" --target=device "${memtest}")"
-       path="$(make_system_path_relative_to_its_root "${memtest}")"
+       gettext_printf "Found memtest image: %s\n" "${memtestbsd}" >&2
+
+       device="$("${grub_probe}" --target=device "${memtestbsd}")"
+       path="$(make_system_path_relative_to_its_root "${memtestbsd}")"
        cat <<EOF
-menuentry "Memtest86+ (netbsd)" {
+${submenu_indentation}menuentry 'Memtest86+ (netbsd)' {
 EOF
-       prepare_grub_to_access_device "${device}" | grub_add_tab
+
+       if [ "x${submenu_indentation}" != "x" ]; then
+               prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
+       else
+               prepare_grub_to_access_device "${device}" | grub_add_tab
+       fi
+
+       cat <<EOF
+       ${submenu_indentation}knetbsd "${path}"
+${submenu_indentation}}
+EOF
+fi
+
+if [ "x${multiple_memtest}" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
        cat <<EOF
-       knetbsd "${path}"
 }
 EOF
 fi
similarity index 97%
rename from sys-apps/memtest86+/memtest86+-4.20-r2.ebuild
rename to sys-apps/memtest86+/memtest86+-4.20-r3.ebuild
index 06dac9cca1e04300e1f45c0ebcd3a37f8784fcb4..07f4158b08019ce3dc729e28184cb4050333f680 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
similarity index 98%
rename from sys-apps/memtest86+/memtest86+-5.01-r1.ebuild
rename to sys-apps/memtest86+/memtest86+-5.01-r2.ebuild
index 6186228b89cc40e6aca99918ba7e415eacf1b2bd..7d3372c82c5be9882733eef4d361c8e80d0fccc4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$