From: Jason Stubbs <jstubbs@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Package notices
Date: Fri, 3 Sep 2004 23:15:05 +0900 [thread overview]
Message-ID: <200409032315.05479.jstubbs@gentoo.org> (raw)
In-Reply-To: <1094224207.7076.9.camel@localhost>
On Saturday 04 September 2004 00:10, Eldad Zack wrote:
> On Fri, 2004-09-03 at 08:10, Nicholas Jones wrote:
> > functions.sh (from baselayout) dependence needs to go away.
> > All used functions need to be logged/rewritten to not use those
> > functions, and instead maintain its own.
>
> I propose overriding einfo/... after sourcing functions.sh in ebuild.sh.
No, they really really need to be new commands. A few examples of why:
eutils.eclass: einfo "Applying various patches (bugfixes/updates)..."
eutils.eclass: einfo "${EPATCH_SINGLE_MSG}"
eutils.eclass: einfo "Applying ${x##*/}..."
virtualx.eclass: einfo "Scanning for a open DISPLAY to start Xvfb..."
mjpegtools/mjpegtools-1.6.0-r7.ebuild: einfo "Building mjpegtools"
drip/drip-0.9.0_alpha3.ebuild: einfo "Rerunnig autoconf/automake..."
mplayer/mplayer-1.0_pre3-r5.ebuild: einfo "Make"
mplayer/mplayer-1.0_pre3-r5.ebuild: einfo "Make completed"
mplayer/mplayer-1.0_pre3-r5.ebuild: einfo "Make install"
mplayer/mplayer-1.0_pre3-r5.ebuild: einfo "Make install completed"
This is all stuff that is meaningless if the build succeeds. As far as I know,
einfo and friends were not created for use in ebuilds and just began being
used as it was convenient at the time.
Secondly, overriding is not good either. If you are overriding, it must be
because the functions do different things. If they are doing different
things, why call them the same thing?
> > All said functions must be rewritten, for portage, with the
> > capability to handle colors and terminals and the like as
> > portage does currently. (People don't want ANSI in their logs.)
>
> Logfiles are handled seperately while screen output uses ANSI.
> If portage could relay the color decision onwards to bash, it would
> take only a small change to enforce that.
>
> > ${T}/notices.${PF}.${TYPE}
>
> I'd rather use a single file - notices.${PF} as the code shows:
> (should be inserted in ebuild.sh after functions.sh is sourced)
>
> ### Code start ###
>
> einfo() {
> enotice info "${*}"
> }
>
> ewarn() {
> enotice warn "${*}"
> }
>
> eerror()
> {
> enotice error "${*}"
> }
>
> enotice()
> {
> local color
> local type
>
> type="${1}"
>
> case "${type}" in
> "info")
> color="${GOOD}"
> ;;
> "warn")
> color="${WARN}"
> ;;
> "error")
> color="${BAD}"
> ;;
> esac
>
> shift
>
> echo "[${type}] ${*}" >> ${T}/notices.${PF}
> echo " ${color}*${NORMAL} ${*}"
>
> }
>
> ### Code End ###
>
> You can also merge the notice file into the package inself:
> (inside dyn_install, just after calling src_install)
>
> #enotice
> if [ -n ${PORT_ENOTICE_DIR} && -r ${T}/notices.${PF} ]
> then
> install -d ${D}${PORT_ENOTICE_DIR}
> cp ${T}/notices.${PF} ${D}${PORT_ENOTICE_DIR}
> fi
>
> or any other way you think is best.
>
> If this is acceptable, I can write a matching notice reader.
The code itself is okay, but what functions are required needs to be
discussed, IMO. Then explicit definitions of when each function is used needs
to be given and each ebuild/eclass updated to use them.
If everyone really really disagrees, I guess you can just create one more
function for the meaningless "pretty" stuff that gets outputted by ebuilds
and eclasses and just convert those. However, be aware that you are adding
another burden of backward compatibility that will only slow down portage's
progress further.
Regards,
Jason Stubbs
--
gentoo-dev@gentoo.org mailing list
next prev parent reply other threads:[~2004-09-03 14:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-02 20:12 [Fwd: Re: [gentoo-dev] Package notices] Eldad Zack
2004-09-02 22:17 ` Chris Gianelloni
2004-09-02 22:54 ` Thomas de Grenier de Latour
2004-09-03 5:10 ` [gentoo-dev] Package notices Nicholas Jones
2004-09-03 14:00 ` Pablo Villalba
2004-09-03 12:47 ` Jason Stubbs
2004-09-03 15:10 ` Eldad Zack
2004-09-03 14:15 ` Jason Stubbs [this message]
2004-09-03 16:15 ` Eldad Zack
2004-09-04 12:55 ` Eldad Zack
-- strict thread matches above, loose matches on Subject: below --
2004-09-01 19:42 Eldad Zack
2004-09-01 21:05 ` William Hubbs
2004-09-01 22:01 ` Thomas de Grenier de Latour
2004-09-02 16:46 ` purslow
2004-09-02 18:06 ` Anton Starikov
2004-09-02 19:59 ` N. Owen Gunden
2004-09-02 18:46 ` Christian Gut
2004-09-02 18:56 ` Alexander Gretencord
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200409032315.05479.jstubbs@gentoo.org \
--to=jstubbs@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox