Re: [RFC] DSPBRIDGE: Kill CAMelCaSiNg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 21, 2009 at 4:12 PM, Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Mon, Sep 21, 2009 at 3:05 PM, Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
>> Yes, I think we should do that, and make some sort of release,
>> possibly squashing all the changes... my current branch counts 218
>> commits.
> I think it should be somehow announced before. Because, f.e., my
> patches is so big to rewrite them
> (and most of them are accepted already, although I can't see commits
> in public repository)

Indeed. I'm planning on making my own "release" and pick your patches,
but for a more "official" release we (or Omar) should make an official
announcement so people send their patches before drawing the line.

>> I did a few more cleanups (yeah, I'm too picky) and here's the result.
> Actually even this could be simplified :-)
>
>> #**
>> #* @brief - changes camel casing to ones with smaller case
>> #*
>> camel_to_norm() {
>>        echo $1 | tr '\_' '+' | sed 's/\([A-Z]\)/_\l\1/g' | sed
>> 's/^_\([a-z]\)/\1/g' | \
> I suppose there is could be used code like: sed -e '<expr1>; <expr2>'
> instead of two or more sed calls.
>
>>        tr 'A-Z' 'a-z' | sed "s/\([a-z][a-z]\+\)/-\1-/g" | tr -d '_'| \
> tr -d '_' is the 's/_//g' expression for sed
>
>>        tr '-' '_' | sed -e "s/_$//g" | sed -e "s/^_//g" | tr '+' '_' | \
>>        sed -e "s/__*/_/g" | sed -e "s/_\([0-9][0-9]*\)/\1/g" | \
>>        sed -e "s/^[a-z]\_\([a-z][a-z]\+\)/\1/g"
> The similar. It could be optimized to a few sed calls (perhaps even to
> one call with all expressions in a sequence).

Yeah, I think this code should be re-factored, but for that I guess
we'll need a list of simple checks to make sure that we get what we
want.

>> # grab the output for only the ones we want..
>> grep "$DIR_FILE" tags | grep -v "^\!" | sed -e
>> "s/\/\^.*\"/REPLACE_1/g" > $TMPFILE
> sed could match and skip lines like grep -v 'smth.': sed -e '/^!/d; ...'
>
>>                                dos2unix -n $file $TMPFILE1
>>                                sed -e "s/\<$token\>/$new/g" $TMPFILE1 > $file
> dos2unix actually one expression for sed, AFAIK.

Yes, but dos2unix (or equivalent) will generate a *huge* diff, that's
why I think it should be done in a different step.

> And new sed versions (starting from 3.8?) have -i which means 'in place'.

That would be better IMHO.

> P.S. And personally I prefer to use perl :-)

For this kind of usage I would prefer it as well (if the code doesn't
become obfuscated), but I'd prefer ruby myself :)

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux