Re: [gentoo-user] Emerge - success or error
Stephan Linkel wrote: Norbert Kamenicky wrote: It's really trivial ... just write simple wrapper for it, i.e. like this: #!/bin/bash /usr/bin/emerge $* echo $? return-code-from-emerge Except of running emerge directly, you will run wrapper (with the same arguments) ... Yes, this would be one option to do this. But, you know, there's always a bigger nerd...I do not want to write something that already exists. But, thanks for your suggestion. I used something similiar... Bye Stephan Ok, for sure such wrapper was already written (in C and other languages), but I wouldn't say it's standard solution anyway, because thats usage of return code ;-). You can also modify emerge source, but that's the worst solution you can do ... noro -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Emerge - success or error
Norbert Kamenicky wrote: It's really trivial ... just write simple wrapper for it, i.e. like this: #!/bin/bash /usr/bin/emerge $* echo $? return-code-from-emerge Except of running emerge directly, you will run wrapper (with the same arguments) ... Yes, this would be one option to do this. But, you know, there's always a bigger nerd...I do not want to write something that already exists. But, thanks for your suggestion. I used something similiar... Bye Stephan smime.p7s Description: S/MIME Cryptographic Signature
Re: [gentoo-user] Emerge - success or error
Ciaran McCreesh wrote: You can use the return code (I'm afraid I don't know Tcl, but in many other scripting languages the var is $?). If portage exited without errors, the value will be 0. If something went wrong, it'll be non-zero. No, I just can not use the return code, because my way to call the emerge does not allow this. I'd have to re-structure the whole prog the get the return code. So, there is no way the get the status of the last emerge like 'emerge status'? Or is there any way to redirect the return code? Bye Stephan -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Emerge - success or error
Stephan Linkel wrote: No, I just can not use the return code, because my way to call the emerge does not allow this. I'd have to re-structure the whole prog the get the return code. So, there is no way the get the status of the last emerge like 'emerge status'? Or is there any way to redirect the return code? It's really trivial ... just write simple wrapper for it, i.e. like this: #!/bin/bash /usr/bin/emerge $* echo $? return-code-from-emerge Except of running emerge directly, you will run wrapper (with the same arguments) ... noro -- [EMAIL PROTECTED] mailing list
[gentoo-user] Emerge - success or error
Hi ML! I've got a problem: I want to write a little prog that emerges automatically a few packages (e.g. a 'emerge -uUD world') but skips failing packages and at the end shows me which packages were emerged succesfully and which not. So, my problem is the following: I use Tcl as program language and use the following to extract the stdout and stderr from the emerge process: set stdoutChannel [open | emerge -uUD $package 2@$stderrChannel RDWR] So I have the stdout in $stdoutChannel and stderr in $stderrChannel, but I have no access to the exit code of the emerge. Or I do not know how to get the exit code. Finally, my question: How can I know if the emerge has finished successfully or if it failed? Is there any string that emerge prints out at the very end of a successful emerge process or is there a method that gives me the status of the last emerge? Thanks for every suggestion! Bye Stephan -- [EMAIL PROTECTED] mailing list
Re: [gentoo-user] Emerge - success or error
On Fri, 24 Oct 2003 15:46:13 +0200 Stephan Linkel [EMAIL PROTECTED] wrote: | How can I know if the emerge has finished successfully or if it | failed? Is there any string that emerge prints out at the very end of | a successful emerge process or is there a method that gives me the | status of the last emerge? You can use the return code (I'm afraid I don't know Tcl, but in many other scripting languages the var is $?). If portage exited without errors, the value will be 0. If something went wrong, it'll be non-zero. -- Ciaran McCreesh Mail: ciaranm at firedrop.org.uk Web:www.firedrop.org.uk System: Gentoo Base System version 1.4.3.10p1 Linux 2.4.20-gentoo-r7 -- [EMAIL PROTECTED] mailing list