Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 130651

Summary: make emerge play sound or do something else on unsuccesfull/succesfull exit
Product: Portage Development Reporter: Fredric Johansson <fredric.miscmail>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Fredric Johansson 2006-04-20 13:28:05 UTC
When doing updates or newinstalling of packages it would be useful if emerge could  do anything optional on exit like playing a sound to make you aware that it failed emerging or it has finished

What do you think?
Comment 1 Zac Medico gentoo-dev 2006-04-20 13:41:22 UTC
The exit status already provides the required functionality.  You can create a wrapper script if you want like this (save it as /usr/local/bin/emerge or something):

#!/usr/bin/env bash
/usr/lib/portage/bin/emerge && aplay success.wav || aplay failure.wav
Comment 2 Zac Medico gentoo-dev 2006-04-20 13:43:18 UTC
Oops, forgot to pass the args to emerge...

#!/usr/bin/env bash
/usr/lib/portage/bin/emerge "$@" && aplay success.wav || aplay failure.wav
Comment 3 Fredric Johansson 2006-04-20 13:57:12 UTC
But that will make emerge always playing sounds on exit even when I make emerge -s foobar or emerge -pv world which might not be preferable all times
Comment 4 Zac Medico gentoo-dev 2006-04-20 16:05:52 UTC
(In reply to comment #3)
> But that will make emerge always playing sounds on exit even when I make emerge
> -s foobar or emerge -pv world which might not be preferable all times

Call the script something different (besides emerge) and only use it when you want sound.
Comment 5 SpanKY gentoo-dev 2006-04-20 16:27:59 UTC
for your .bashrc:
semerge() { emerge "$@" && aplay success.wav || aplay failure.wav ; }