public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] \" fixes
@ 2001-08-10 23:37 Daniel Robbins
  2001-08-11  3:18 ` Mikael Hallendal
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Robbins @ 2001-08-10 23:37 UTC (permalink / raw
  To: gentoo-dev

Hi All,

I just all the ebuilds on CVS that needed \" fixes due to an upgrade of the
"try" command (about 50).  This means that everyone should rsync/cvs update and
remerge Portage, even if you've done so in the past few days.  This means that
developers can now type:

	try make COPT="$CFLAGS"

rather than the old way:

	try make COPT=\"$CFLAGS\"

Also, Aron Griffis' "die" and "assert" commands are now part of the Portage
currently on CVS, and developers should start transitioning to these new
commands as they're much better than "try".

Best Regards,

-- 
Daniel Robbins					<drobbins@gentoo.org>
Chief Architect/President			http://www.gentoo.org 
Gentoo Technologies, Inc.			



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] \" fixes
  2001-08-10 23:37 [gentoo-dev] \" fixes Daniel Robbins
@ 2001-08-11  3:18 ` Mikael Hallendal
  2001-08-12  2:43   ` [gentoo-dev] how to use die() and assert_true_or_die() Chris Houser
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Hallendal @ 2001-08-11  3:18 UTC (permalink / raw
  To: gentoo-dev

Hi!

I think it would be good if someone (Aron?) could post a short version
of Aron's mail (which by the way was well written and interesting
reading, thanks) to describe when to use which for those that hasn't
read it (it was also long :). One without the technical internals of
the commands. Just a quick description and an example of each. 

Regards,
Mikael Hallendal

Daniel Robbins <drobbins@gentoo.org> writes:

> Hi All,
> 
> I just all the ebuilds on CVS that needed \" fixes due to an upgrade
> of the "try" command (about 50).  This means that everyone should
> rsync/cvs update and remerge Portage, even if you've done so in the
> past few days.  This means that developers can now type:
> 
> 	try make COPT="$CFLAGS"
> 
> rather than the old way:
> 
> 	try make COPT=\"$CFLAGS\"
> 
> Also, Aron Griffis' "die" and "assert" commands are now part of the
> Portage currently on CVS, and developers should start transitioning to
> these new commands as they're much better than "try".
> 
> Best Regards,
> 
> -- 
> Daniel Robbins					<drobbins@gentoo.org>
> Chief Architect/President			http://www.gentoo.org 
> Gentoo Technologies, Inc.			
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@cvs.gentoo.org
> http://cvs.gentoo.org/mailman/listinfo/gentoo-dev

-- 
Mikael Hallendal                micke@codefactory.se
CodeFactory AB                  http://www.codefactory.se/
Office: +46 (0)8 587 583 05     Cell: +46 (0)709 718 918




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-dev] how to use die() and assert_true_or_die()
  2001-08-11  3:18 ` Mikael Hallendal
@ 2001-08-12  2:43   ` Chris Houser
  2001-08-12 12:59     ` Daniel Robbins
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Houser @ 2001-08-12  2:43 UTC (permalink / raw
  To: gentoo-dev

Okay, here's some quick documentation on Aron Griffis' new "exception
handling" functions.  I am confidant Aron will correct any mistakes I
make here.


Although try() still exists, there are two new functions available that
are much better.  For a details on why try() should be deprecated, and
for more examples of how to use these functions in less common
situations, see Aron's earlier messages.  Note that these new functions
give more detailed error messages than try() did.

--- Simple die() --
In most cases where you used to use try(), you should now use die().
For example, the Development HOWTO has the following:

    try ./configure ${myvar} --prefix=/usr --host=${CHOST}

To use die() instead, use this syntax:

    ./configure ${myvar} --prefix=/usr --host=${CHOST} || die

You may optionally include a message to describe what failed:

    ./configure ${myvar} --prefix=/usr --host=${CHOST} || die "Bad configure"


--- Pipelined die() --
If you want to check the results of a pipelined command, you may
only need to attach die to the last command.  This is often sufficient
because if commands earlier in the pipeline fail, later commands often
fail as well:

    bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p0 || die

However, it is possible for earlier commands to fail and for later ones
to succeed anyway.  This example, for instance, will appear to succeed
if the patch file does not exists.  So, to make sure your .ebuild
catches this type of situation, you can attach die to each command of
the pipeline:

    ( bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 || die ) | ( patch -p0 || die )


--- assert_true_or_die() --
This function is meant to be used when you don't want to make long
commands even longer by adding the "|| die" syntax.  To use it, simply
add the function call after the command you want to check:

    ./configure ${myvar} --prefix=/usr --host=${CHOST}
    assert_true_or_die "Bad configure"

Note that using the function this way doesn't allow you to check
multiple commands in a pipeline the way die() does.

--Chouser



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] how to use die() and assert_true_or_die()
  2001-08-12  2:43   ` [gentoo-dev] how to use die() and assert_true_or_die() Chris Houser
@ 2001-08-12 12:59     ` Daniel Robbins
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Robbins @ 2001-08-12 12:59 UTC (permalink / raw
  To: gentoo-dev

On Sun, Aug 12, 2001 at 04:41:53AM -0400, Chris Houser wrote:

> --- assert_true_or_die() --
> This function is meant to be used when you don't want to make long
> commands even longer by adding the "|| die" syntax.  To use it, simply
> add the function call after the command you want to check:
> 
>     ./configure ${myvar} --prefix=/usr --host=${CHOST}
>     assert_true_or_die "Bad configure"
> 
> Note that using the function this way doesn't allow you to check
> multiple commands in a pipeline the way die() does.

The "assert_true_or_die" function has been officially renamed to "assert".

Best Regards,

-- 
Daniel Robbins					<drobbins@gentoo.org>
Chief Architect/President			http://www.gentoo.org 
Gentoo Technologies, Inc.			



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-12 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-10 23:37 [gentoo-dev] \" fixes Daniel Robbins
2001-08-11  3:18 ` Mikael Hallendal
2001-08-12  2:43   ` [gentoo-dev] how to use die() and assert_true_or_die() Chris Houser
2001-08-12 12:59     ` Daniel Robbins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox