RPM

Comment 10 for bug 913221

Revision history for this message
In , Zen25000 (zen25000) wrote :

I'm re-opening as I have now another need for this to work.

In an attempt to stop grub2 updates from happening if /boot/grub2/drakboot.conf does not exist I tested this:

%pre
if [ $1 -eq 2 ] && ![ -e /boot/grub2/drakboot.conf ]; then
echo -e "Cannot update grub2 without a known target boot drive \n \
please create /boot/grub2/drakboot.conf containing boot=/dev/sdX \n \
and try to update again"
exit 1
fi

The result:

[root@jackodesktop grub2]# rpm -qa|grep grub2
grub2-mageia4-theme-dejavu-1.0-1.mga4
grub2-2.00-58.mga4

[root@jackodesktop grub2]# urpmi --auto-update
medium "Extra Release (zm-repo46)" is up-to-date
medium "Core Release (zm-repo1)" is up-to-date
medium "Core Updates (zm-repo3)" is up-to-date
medium "Nonfree Release (zm-repo11)" is up-to-date
medium "Nonfree Updates (zm-repo13)" is up-to-date
medium "Tainted Release (zm-repo21)" is up-to-date
medium "Tainted Updates (zm-repo23)" is up-to-date
medium "Core 32bit Release (zm-repo31)" is up-to-date
medium "Core 32bit Updates (zm-repo32)" is up-to-date
medium "Nonfree 32bit Release (zm-repo36)" is up-to-date
medium "Nonfree 32bit Updates (zm-repo37)" is up-to-date
medium "Tainted 32bit Release (zm-repo41)" is up-to-date
medium "Tainted 32bit Updates (zm-repo42)" is up-to-date
To satisfy dependencies, the following package is going to be installed:
  Package Version Release Arch
(medium "Extra Release (zm-repo46)")
  grub2 2.00 59.mga4 x86_64
16B of disk space will be freed.
2MB of packages will be retrieved.
Proceed with the installation of one package? (Y/n) y

[root@jackodesktop grub2]# rpm -q grub2
grub2-2.00-58.mga4
[root@jackodesktop grub2]#

Nothing reported by urpmi at all (the package was already in cache so no download shown)

How can I get this message to be displayed in both GUI and urpmi when the install fails?