Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Ryan Hill <dirtyepic@g.o>
Subject: Re: Default blank lines for error, elog, einfo, etc
Date: Wed, 4 Jun 2008 18:45:24 -0600
On Wed, 04 Jun 2008 15:31:58 -0600
Joe Peterson <lavajoe@g.o> wrote:

> William L. Thomson Jr. wrote:
> > Just a quick thought looking over a couple ebuilds. It seems most
> > times anyone does a error, elog, einfo, or similar. They start and
> > end with a few blank lines. Calls with no arguments.
> > 
> > Is there any reason not to make that a default? Other than
> > difficulty of implementation. Anytime they are invoked back to
> > back. Default blank lines are added at the beginning or end.
> 
> I have run into the same dilemma - wanting to separate blocks of
> warnings/logs/info by blank space.  And the particular issue I've run
> into is which calls to use (i.e. what color to make the "*").  For
> example, I might have two possible warnings back-to-back, and each is
> conditional:
> 
> if ! use flac; then
> 	ewarn "'flac' USE flag is not set.  Blah, blah..."
> 	ewarn "More blah blah..."
> 	ewarn ""
> fi
> if ! use lame; then
> 	ewarn "'lame' USE flag is not set.  Blah, blah..."
> 	ewarn "More blah blah..."
> 	ewarn ""
> fi
> 
> Problem is, the blank line doesn't really belong in the "warning"
> itself
> - it's meant as a separator.  And if both happen, it makes sense to
> color the "*" logically (should it be yellow rather than, say, green?
> If the next block of output is "green", it can look funny to see a
> blank yellow as the separator, for example.
> 
> Also, there is that question of whether to put the blank line before
> or after the block, and if conditional, it can be tricky to make the
> full output look nice for all possibilities.  I tend not to want to
> put a blank line at the very end of the output (trying to be
> consistent with most other ebuilds), even though that might make
> things more clear. Also, I don't know inside the conditional whether
> it might be the last block of output or of another conditional might
> follow (for example).
> 
> So I am in favor of some smart code in portage to do "nice looking"
> blank line logic that would also make reading the output more clear.
> Something like "eblank" or "eseparator" could be aware of the previous
> and next "color" and do the right thing.  Putting a blank line
> consistently at the end of the ebuild output but before portage's end
> summary would be nice as well (and make it easier to spot problems
> when looking at the output).  Also, if the ebuild itself tries to
> insert blanks at the start or end, portage could remove those and
> enforce its own spacing rules...

I just throw a couple echos around any output.

echo
elog "Your shoe is untied."
elog
elog "Please run this command again when your footwear is properly"
elog "secured."
echo

I think doing any kind of automatic pretty-print formatting is
overkill, but that's just my opinion.


-- 
fonts, gcc-porting,                               by design, by neglect
mips, treecleaner,                        for a fact or just for effect
wxwidgets @ gentoo     EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
Attachment:
signature.asc (PGP signature)
Replies:
Re: Re: Default blank lines for error, elog, einfo, etc
-- William L. Thomson Jr.
References:
Default blank lines for error, elog, einfo, etc
-- William L. Thomson Jr.
Re: Default blank lines for error, elog, einfo, etc
-- Joe Peterson
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Default blank lines for error, elog, einfo, etc
Next by thread:
Re: Re: Default blank lines for error, elog, einfo, etc
Previous by date:
Nominations open for the Gentoo Council 2008/2009
Next by date:
Re: Nominations for council


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.