Subject: Re: emailing MESSAGE/+DISPLAY
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 06/11/2003 23:49:28
On Thu, 12 Jun 2003, Greg A. Woods wrote:

> those packages as parameters to "pkg_info -D".  The key point is to make
> sure that all packages store important installation and configuration
> instructions in the +DISPLAY file, and that additional "dynamic"
> messages such as those generated by the pkgsrc/mk/install scripts, are
> also appended to the +DISPLAY file.  Everything after that is simply a

This is a different subject than what I introduced in this thread. But, I
definitely agree. (Maybe I'll provide a patch for that too.)

> matter of reporting -- i.e. when the report is generated, what subset of
> information is included in the report, and to which transport, address,
> display, or whatever it is fed to.  The important thing is to first
> record this information as a part of the package registration in a
> standard place in the registration database where the standard packate
> management tools can access it at any time and again repeatedly as
> desired.

Definitely.

> > (And considering that the dependencies' +DISPLAY contents are likely to fly
> > by on the way to installing the top-level package, those are the ones the
> > user wants to have available...!)
>
> I agree that having this information fly by while the pkg_add is running
> is not acceptable.

That's the point of having an optional email. It makes it convenient. Some
admins may not want to do:

ls -t /var/db/pkg/*/+DISPLAY | xargs cat | less # or whatever

> recorded and available until the package is de-installed.  Just please
> don't make the e-mailing of these reports a default action.

Yes, it will be optional. (And my patch won't do it by default.)

> >From a fail-safe design perspective it might actually make more sense to
> not have REQUIRE and INSTALL scripts dynamically display anything but
> rather to always append this output to the +DISPLAY file and to only
> display it to the user running pkg_add after the fact by effectively
> running "pkg_info -D".  This way it is guaranteed that this information

That sounds like a good idea.

Now back to my original question:

What switch or environment variables should I use so pkg_add will email
the +DISPLAY files?

Last year, it was suggested that for bsd.pkg.mk to have MAIL_MESSAGE=root
or MAIL_MESSAGE=user -- and if user then email the MESSAGE to the user and
to root. (Now to record the username, because currently it does the SU_CMD
and becomes root at that point. Maybe this needs to be reordered: because
root privilege is not needed to just display the MESSAGE.)

   Jeremy C. Reed
   http://bsd.reedmedia.net/