Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 25855 Details for
Bug 11359
[NEW FEATURE] pkg_postinst/pkg_preinst ewarn/einfo logging
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
updated functions.sh.patch
functions.sh.patch (text/plain), 2.13 KB, created by
Peter Ruskin
on 2004-02-18 07:30:50 UTC
(
hide
)
Description:
updated functions.sh.patch
Filename:
MIME Type:
Creator:
Peter Ruskin
Created:
2004-02-18 07:30:50 UTC
Size:
2.13 KB
patch
obsolete
>--- functions-old.sh 2003-08-18 21:49:35.000000000 -0400 >+++ functions.sh 2003-08-19 19:32:13.000000000 -0400 >@@ -121,6 +121,53 @@ > BRACKET=$'\e[34;01m' > fi > >+ >+# void sendmessages(void) >+# >+# send any einfo, ewarn, or eerror messages that have collected >+# upon exit of this shell (part of the emergemail feature). >+# >+trap sendmessages EXIT >+sendmessages() { >+ for SEVERITY in "information" "warning" "error"; do >+ BUFFER=${TMPDIR}/emergemail.buffer.${SEVERITY} >+ if [ -f ${BUFFER} ]; then >+ if [ -x /usr/sbin/sendmail ]; then >+ /usr/sbin/sendmail root < ${BUFFER} >+ unset ${EMESSAGES} >+ else >+ echo -e " ${WARN}*${NORMAL} the emergemail FEATURE "\ >+ "was unable to find /usr/sbin/sendmail. " >+ echo -e " ${WARN}*${NORMAL} You must have a Mail "\ >+ "Transfer Agent (MTA) such as postfix, exim," >+ echo -e " ${WARN}*${NORMAL} ssmtp, etc. to use this "\ >+ "feature." >+ fi >+ rm -f ${BUFFER} >+ fi >+ done >+} >+ >+ >+# void emergemail(char *severity, char *message) >+# >+# send mail to root with the given message (if possible) >+# severity is either "information" (for einfo), >+# "warning" (for ewarn), >+# or "error" (for eerror). >+# >+emergemail() { >+ SEVERITY=$1 >+ MESSAGE=$2 >+ BUFFER=${TMPDIR}/emergemail.buffer.${SEVERITY} >+ if echo ${FEATURES} | grep -iq emergemail; then >+ if [ ! -f ${BUFFER} ]; then >+ echo "Subject: ${SEVERITY} from emerge of ${P}" > ${BUFFER} >+ echo -e "To: root\n\n" >> ${BUFFER} >+ fi >+ echo -e ${MESSAGE} >> ${BUFFER} >+ fi >+} >+ > # void esyslog(char* priority, char* tag, char* message) > # > # use the system logger to log a message >@@ -153,6 +200,8 @@ > echo -e " ${GOOD}*${NORMAL} ${*}" > fi > >+ emergemail information "${*}" >+ > return 0 > } > >@@ -166,6 +215,8 @@ > echo -ne " ${GOOD}*${NORMAL} ${*}" > fi > >+ emergemail information "${*}" >+ > return 0 > } > >@@ -181,6 +232,8 @@ > echo -e " ${WARN}*${NORMAL} ${*}" > fi > >+ emergemail warning "${*}" >+ > # Log warnings to system log > esyslog "daemon.warning" "rc-scripts" "${*}" > >@@ -199,6 +252,8 @@ > echo -e " ${BAD}*${NORMAL} ${*}" > fi > >+ emergemail error "${*}" >+ > # Log errors to system log > esyslog "daemon.err" "rc-scripts" "${*}" >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11359
:
6039
|
6046
|
16300
|
16341
| 25855 |
27224
|
27382
|
36713
|
36784
|
43541
|
65206