diff options
Diffstat (limited to 'sys-boot')
-rw-r--r-- | sys-boot/grub-config-redcore/grub-config-redcore-1337-r1.ebuild (renamed from sys-boot/grub-config-redcore/grub-config-redcore-1337.ebuild) | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sys-boot/grub-config-redcore/grub-config-redcore-1337.ebuild b/sys-boot/grub-config-redcore/grub-config-redcore-1337-r1.ebuild index baf5cf85..901e9925 100644 --- a/sys-boot/grub-config-redcore/grub-config-redcore-1337.ebuild +++ b/sys-boot/grub-config-redcore/grub-config-redcore-1337-r1.ebuild @@ -17,24 +17,19 @@ RDEPEND="sys-boot/grub" S="${FILESDIR}" -pkg_preinst() { - # Backup GRUB configuration file - if [[ -f ""${ROOT}"etc/default/grub" ]]; then - cp -avx ""${ROOT}"etc/default/grub" ""${ROOT}"etc/default/grub.backup" - fi -} - src_install() { - # if we overwrite /etc/default/grub we may break users setup - # so install the new GRUB configuration file as example only dodir "etc/default" || die insinto "etc/default" || die newins grub grub.example || die } +pkg_preinst() { + if [[ -f ""${ROOT}"etc/default/grub" ]]; then + mv ""${ROOT}"etc/default/grub" ""${ROOT}"etc/default/grub.bak" + fi + pkg_postinst() { - # Restore GRUB configuration file - if [[ -f ""${ROOT}"etc/default/grub.backup" ]]; then - cp -avx ""${ROOT}"etc/default/grub.backup" ""${ROOT}"etc/default/grub" + if [[ -f ""${ROOT}"etc/default/grub.bak" ]]; then + mv ""${ROOT}"etc/default/grub.bak" ""${ROOT}"etc/default/grub" fi } |