[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] hush.c - export -n flag support
From:       Bayram Kurumahmut <bayram.kurumahmut () gmail ! com>
Date:       2009-04-21 7:28:19
Message-ID: 5165ab000904210028l7c9a3813kd1af0fdee1d8f36d () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I see export -n patch is applied and new test files are added with
enhancements.

Thanks,
Bayram

On Tue, Apr 21, 2009 at 9:55 AM, Bayram Kurumahmut <kbayram@ubicom.com>wrote:

>
> A new patch and updated test files. Tests previously mentioned are applied
> and passed.
>
> bayram@bk-pc:/media/disk-1/busybox-trunk$ bash
> shell/hush_test/hush-misc/export-n.tests
> declare -x aaa1="'''"
> declare -x aaa2=""
> declare -x aaa3="'''abc"
> declare -x aaa8="8"
> aaa9=9
> aaa10=10
> Done
> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush
> shell/hush_test/hush-misc/export-n.tests
> export aaa1="'''"
> export aaa2=''
> export aaa3="'''"'abc'
> export aaa8='8'
> aaa9=9
> aaa10=10
> Done
>
> bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c 'export -n VVV=z; env |
> grep VVV'
> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'export -n VVV=z; env
> | grep VVV'
>
> bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c 'echo $HOME; echo
> Unexporting; export -n HOME; HOME=z; env | grep HOME'
> /home/bayram
> Unexporting
> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'echo $HOME; echo
> Unexporting; export -n HOME; HOME=z; env | grep HOME'
> /home/bayram
> Unexporting
>
> When I disable '-n' support, the following output still exists. As Mike
> said, there may be provided a common method for option handling.
>
> bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c 'export -nnnnnnnnn
> nnnnnnnn; env | grep nnnnn'
> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c 'export -nnnnnnnnn
> nnnnnnnn; env | grep nnnnn'
> -nnnnnnnnn=
> nnnnnnnn=
>
>
> Regards,
> Bayram
>
> -----Original Message-----
> From: busybox-bounces@busybox.net on behalf of Mike Frysinger
> Sent: Mon 20.04.2009 16:06
> To: busybox@busybox.net
> Subject: Re: [PATCH] hush.c - export -n flag support
>
> On Monday 20 April 2009 18:05:09 Denys Vlasenko wrote:
> > On Monday 20 April 2009 21:11, Bayram Kurumahmut wrote:
> > > Added two new files: shell/hush_test/export-n.tests and
> > > shell/hush_test/export-n.right
> > > Added set then export -n test and test cases from my first mail
> > > Config.in help text changed
> >
> > Problems:
> >
> > Did you try to build with HUSH_EXPORT_N off?
> > It still accepts -n even then.
>
> this is unrelated to his code.  not throwing an error with unknown option
> is
> not the same thing as accepting it.  we should add logic that rejects all
> unknown options.  that would result in -n being rejected by common code
> when
> support is turned off.
>
> so, ignoring his patch completely, current code does not throw errors when
> doing things like:
> export -n
> export -Z
> export -askdlfjasklfjasklf
> -mike
>
>
>
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>



-- 
Bayram

[Attachment #5 (text/html)]

I see export -n patch is applied and new test files are added with \
enhancements.<br><br>Thanks,<br>Bayram<br><br><div class="gmail_quote">On Tue, Apr \
21, 2009 at 9:55 AM, Bayram Kurumahmut <span dir="ltr">&lt;<a \
href="mailto:kbayram@ubicom.com">kbayram@ubicom.com</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div>

<br>

<p><font size="2">A new patch and updated test files. Tests previously mentioned are \
applied and passed.<br> <br>
bayram@bk-pc:/media/disk-1/busybox-trunk$ bash \
shell/hush_test/hush-misc/export-n.tests<div class="im"><br> declare -x \
aaa1=&quot;&#39;&#39;&#39;&quot;<br> declare -x aaa2=&quot;&quot;<br>
declare -x aaa3=&quot;&#39;&#39;&#39;abc&quot;<br>
declare -x aaa8=&quot;8&quot;<br>
aaa9=9<br>
aaa10=10<br>
Done<br></div>
bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush \
shell/hush_test/hush-misc/export-n.tests<div class="im"><br> export \
aaa1=&quot;&#39;&#39;&#39;&quot;<br> export aaa2=&#39;&#39;<br>
export aaa3=&quot;&#39;&#39;&#39;&quot;&#39;abc&#39;<br></div>
export aaa8=&#39;8&#39;<div class="im"><br>
aaa9=9<br>
aaa10=10<br>
Done<br>
<br></div>
bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c &#39;export -n VVV=z; env | grep \
VVV&#39;<br> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c &#39;export -n \
VVV=z; env | grep VVV&#39;<br> <br>
bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c &#39;echo $HOME; echo Unexporting; \
                export -n HOME; HOME=z; env | grep HOME&#39;<br>
/home/bayram<br>
Unexporting<br>
bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c &#39;echo $HOME; echo \
                Unexporting; export -n HOME; HOME=z; env | grep HOME&#39;<br>
/home/bayram<br>
Unexporting<br>
<br>
When I disable &#39;-n&#39; support, the following output still exists. As Mike said, \
there may be provided a common method for option handling.<br> <br>
bayram@bk-pc:/media/disk-1/busybox-trunk$ bash -c &#39;export -nnnnnnnnn nnnnnnnn; \
env | grep nnnnn&#39;<br> bayram@bk-pc:/media/disk-1/busybox-trunk$ ./hush -c \
                &#39;export -nnnnnnnnn nnnnnnnn; env | grep nnnnn&#39;<br>
-nnnnnnnnn=<br>
nnnnnnnn=<br>
<br>
<br>
Regards,<br><font color="#888888">
Bayram</font><div class="im"><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:busybox-bounces@busybox.net" \
                target="_blank">busybox-bounces@busybox.net</a> on behalf of Mike \
                Frysinger<br>
Sent: Mon 20.04.2009 16:06<br>
To: <a href="mailto:busybox@busybox.net" target="_blank">busybox@busybox.net</a><br>
Subject: Re: [PATCH] hush.c - export -n flag support<br>
<br></div><div><div></div><div class="h5">
On Monday 20 April 2009 18:05:09 Denys Vlasenko wrote:<br>
&gt; On Monday 20 April 2009 21:11, Bayram Kurumahmut wrote:<br>
&gt; &gt; Added two new files: shell/hush_test/export-n.tests and<br>
&gt; &gt; shell/hush_test/export-n.right<br>
&gt; &gt; Added set then export -n test and test cases from my first mail<br>
&gt; &gt; Config.in help text changed<br>
&gt;<br>
&gt; Problems:<br>
&gt;<br>
&gt; Did you try to build with HUSH_EXPORT_N off?<br>
&gt; It still accepts -n even then.<br>
<br>
this is unrelated to his code.  not throwing an error with unknown option is<br>
not the same thing as accepting it.  we should add logic that rejects all<br>
unknown options.  that would result in -n being rejected by common code when<br>
support is turned off.<br>
<br>
so, ignoring his patch completely, current code does not throw errors when<br>
doing things like:<br>
export -n<br>
export -Z<br>
export -askdlfjasklfjasklf<br>
-mike<br>
<br>
<br>
<br>
</div></div></font>
</p>

</div>
<br>_______________________________________________<br>
busybox mailing list<br>
<a href="mailto:busybox@busybox.net">busybox@busybox.net</a><br>
<a href="http://lists.busybox.net/mailman/listinfo/busybox" \
target="_blank">http://lists.busybox.net/mailman/listinfo/busybox</a><br></blockquote></div><br><br \
clear="all"><br>-- <br>Bayram<br>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic