On 03/15/10 08:18 PM, Shawn Walker wrote:
> On 03/15/10 08:12 PM, Joseph J. VLcek wrote:
>> Thank you Shawn, Dave and Keith.
>>
>> I'm cc-ing Danek.
>>
>> My understanding from what Danek had described to me was that the "eval"
>> is not needed for pkgsend open.
>>
>> Danek did I misunderstand?
>>
>> The code in question is in the webrev:
>> http://cr.opensolaris.org/~joev/bug15163
>>
>> File:
>> http://cr.opensolaris.org/~joev/bug15163/usr/src/cmd/distro_const/auto_install/ai_publish_pkg.html
>>
>>
>>
>> Line:
>>
>> 370 $(pkgsend -s ${PKG_REPO} open ${PKG_NAME})
>>
>> Should this be:
>>
>> eval $(pkgsend -s ${PKG_REPO} open ${PKG_NAME})
>
> By default, pkgsend open will print using this output format:
>
> export PKG_TRANS_ID=%s
>
> So I don't think you need to eval it, but I suppose that depends on the
> shell in question.

However, I would point out that if pkgsend open exits with an error, 
since you've directly executed the output, you may not get what you expect.

It would probably be safer to capture the output of pkgsend open, check 
the exit code, if non-zero, display it and exit with error, if zero, $() 
the output.

Cheers,

-- 
Shawn Walker

Reply via email to