Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
On Tue, 2017-03-28 at 06:54 -0400, Robert P. J. Day wrote: > i'm fine with that, as long as it's officially POSIX. that also > suggests the alternate tests: > > [ "${VAR}" ] > [ ! "${VAR}" ] I personally prefer this. ! instead of -z feels more consistent (when not using the special "-n", let's also avoid the special "-z" and use the more general "!" instead. -- Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter. -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
On Tue, 28 Mar 2017, Peter Kjellerstedt wrote: > > -Original Message- > > From: openembedded-core-boun...@lists.openembedded.org > > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of > > Robert P. J. Day > > Sent: den 28 mars 2017 11:57 > > To: Richard Purdie > > Cc: OE Core mailing list > > Subject: Re: [OE-core] [PATCH] classes: Replace "if test" file tests > > with POSIX file tests > > > > On Mon, 27 Mar 2017, Richard Purdie wrote: > > > > > On Sat, 2017-03-25 at 14:03 -0400, Robert P. J. Day wrote: > > > > In entire meta/classes/ directory, replace shell tests of the form > > > > "if test -? ..." with POSIX tests of the form "if [ -? ... > > > > > > > > Signed-off-by: Robert P. J. Day <rpj...@crashcourse.ca> > > > > > > > > --- > > > > > > > > as i cannot abide those silly "if test" constructs, i zipped > > > > through > > > > and changed them to POSIX form. is there any objection to this kind > > > > of > > > > cleanup? next up ... all those "x${VAR} = x" tests ... > > > > > > I've merged most of this. There were pieces of the diff that simply > > > didn't apply so I skipped them. > > > > > > The reason I've taken what applied is that this is very expensive > > > for us to test right now and I made the most of the testing time I > > > had on the weekend. The issue is changes to the core classes rebuild > > > everything so we can't reuse sstate and the tests are much slower. > > > > > > We're running late with M3 rc2 but just about to build it and I > > > thought it was worth getting some of this in rather none at all. > > > Please do figure out the remaining pieces and send them and we may > > > or may not tweak the remaining bits in M4. > > > > my next cleanup was going to be (as mentioned above) replace all > > those silly "x${VAR} = x" string tests with either of: > > > > [ -z "${VAR}" ] > > [ -n "${VAR}" ] > > There is no reason to have the -n in there. This is better: > > [ -z "${VAR}" ] > [ "${VAR}" ] i'm fine with that, as long as it's officially POSIX. that also suggests the alternate tests: [ "${VAR}" ] [ ! "${VAR}" ] i am happy to defer to the will of the masses, it's just nice to have a style standard one way or the other. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
On Tue, 2017-03-28 at 05:56 -0400, Robert P. J. Day wrote: > On Mon, 27 Mar 2017, Richard Purdie wrote: > > > > > On Sat, 2017-03-25 at 14:03 -0400, Robert P. J. Day wrote: > > > > > > In entire meta/classes/ directory, replace shell tests of the > > > form > > > "if test -? ..." with POSIX tests of the form "if [ -? ... > > > > > > Signed-off-by: Robert P. J. Day> > > > > > --- > > > > > > as i cannot abide those silly "if test" constructs, i zipped > > > through > > > and changed them to POSIX form. is there any objection to this > > > kind > > > of > > > cleanup? next up ... all those "x${VAR} = x" tests ... > > I've merged most of this. There were pieces of the diff that simply > > didn't apply so I skipped them. > > > > The reason I've taken what applied is that this is very expensive > > for us to test right now and I made the most of the testing time I > > had on the weekend. The issue is changes to the core classes > > rebuild > > everything so we can't reuse sstate and the tests are much slower. > > > > We're running late with M3 rc2 but just about to build it and I > > thought it was worth getting some of this in rather none at all. > > Please do figure out the remaining pieces and send them and we may > > or may not tweak the remaining bits in M4. > my next cleanup was going to be (as mentioned above) replace all > those silly "x${VAR} = x" string tests with either of: > > [ -z "${VAR}" ] > [ -n "${VAR}" ] > > is there time to get that in before the next freeze? if so, i can do > it quickly for testing; if not, i guess it can just wait. I think that needs to wait for 2.4 but I agree its worth cleaning that up. Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
> -Original Message- > From: openembedded-core-boun...@lists.openembedded.org > [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of > Robert P. J. Day > Sent: den 28 mars 2017 11:57 > To: Richard Purdie > Cc: OE Core mailing list > Subject: Re: [OE-core] [PATCH] classes: Replace "if test" file tests > with POSIX file tests > > On Mon, 27 Mar 2017, Richard Purdie wrote: > > > On Sat, 2017-03-25 at 14:03 -0400, Robert P. J. Day wrote: > > > In entire meta/classes/ directory, replace shell tests of the form > > > "if test -? ..." with POSIX tests of the form "if [ -? ... > > > > > > Signed-off-by: Robert P. J. Day <rpj...@crashcourse.ca> > > > > > > --- > > > > > > as i cannot abide those silly "if test" constructs, i zipped > > > through > > > and changed them to POSIX form. is there any objection to this kind > > > of > > > cleanup? next up ... all those "x${VAR} = x" tests ... > > > > I've merged most of this. There were pieces of the diff that simply > > didn't apply so I skipped them. > > > > The reason I've taken what applied is that this is very expensive > > for us to test right now and I made the most of the testing time I > > had on the weekend. The issue is changes to the core classes rebuild > > everything so we can't reuse sstate and the tests are much slower. > > > > We're running late with M3 rc2 but just about to build it and I > > thought it was worth getting some of this in rather none at all. > > Please do figure out the remaining pieces and send them and we may > > or may not tweak the remaining bits in M4. > > my next cleanup was going to be (as mentioned above) replace all > those silly "x${VAR} = x" string tests with either of: > > [ -z "${VAR}" ] > [ -n "${VAR}" ] There is no reason to have the -n in there. This is better: [ -z "${VAR}" ] [ "${VAR}" ] > is there time to get that in before the next freeze? if so, i can do > it quickly for testing; if not, i guess it can just wait. > > rday //Peter -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
On Mon, 27 Mar 2017, Richard Purdie wrote: > On Sat, 2017-03-25 at 14:03 -0400, Robert P. J. Day wrote: > > In entire meta/classes/ directory, replace shell tests of the form > > "if test -? ..." with POSIX tests of the form "if [ -? ... > > > > Signed-off-by: Robert P. J. Day> > > > --- > > > > as i cannot abide those silly "if test" constructs, i zipped > > through > > and changed them to POSIX form. is there any objection to this kind > > of > > cleanup? next up ... all those "x${VAR} = x" tests ... > > I've merged most of this. There were pieces of the diff that simply > didn't apply so I skipped them. > > The reason I've taken what applied is that this is very expensive > for us to test right now and I made the most of the testing time I > had on the weekend. The issue is changes to the core classes rebuild > everything so we can't reuse sstate and the tests are much slower. > > We're running late with M3 rc2 but just about to build it and I > thought it was worth getting some of this in rather none at all. > Please do figure out the remaining pieces and send them and we may > or may not tweak the remaining bits in M4. my next cleanup was going to be (as mentioned above) replace all those silly "x${VAR} = x" string tests with either of: [ -z "${VAR}" ] [ -n "${VAR}" ] is there time to get that in before the next freeze? if so, i can do it quickly for testing; if not, i guess it can just wait. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH] classes: Replace "if test" file tests with POSIX file tests
On Sat, 2017-03-25 at 14:03 -0400, Robert P. J. Day wrote: > In entire meta/classes/ directory, replace shell tests of the form > "if test -? ..." with POSIX tests of the form "if [ -? ... > > Signed-off-by: Robert P. J. Day> > --- > > as i cannot abide those silly "if test" constructs, i zipped > through > and changed them to POSIX form. is there any objection to this kind > of > cleanup? next up ... all those "x${VAR} = x" tests ... I've merged most of this. There were pieces of the diff that simply didn't apply so I skipped them. The reason I've taken what applied is that this is very expensive for us to test right now and I made the most of the testing time I had on the weekend. The issue is changes to the core classes rebuild everything so we can't reuse sstate and the tests are much slower. We're running late with M3 rc2 but just about to build it and I thought it was worth getting some of this in rather none at all. Please do figure out the remaining pieces and send them and we may or may not tweak the remaining bits in M4. Cheers, Richard -- ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core