Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Mike Frysinger
On Wednesday 26 September 2007, Donnie Berkholz wrote:
> On 00:02 Wed 26 Sep , Stephen Bennett wrote:
> > On Tue, 25 Sep 2007 11:10:34 +0200
> >
> > Robert Buchholz <[EMAIL PROTECTED]> wrote:
> > > I already wondered a while back:
> > > sed only fails if the file does not exist, but not if there was no
> > > replacement. Is there any way to force it to?
> >
> > Off the top of my head...
> >
> > sed -e '1{x;s/^/0/;x;ta;:a}'
> > -e 's/$STRING/$REPLACEMENT/'
> > -e 'Tb;x;s/^/1/;x;:b;${p;x;/^0/Q1;Q0};'
>
> I spent a few minutes trying to decipher that without luck. Could you
> walk me through it?

sed maintains two buffers - pattern and hold (which start out empty) and 
that's the trick here

{ } - used to group commands together

1 - only match first line (it's an address match)
x - swap pattern space and hold space
s/^/0/ - turn the (now) empty pattern space into "0"
x - swap pattern space and hold space
ta - branch to label a if previous expression matched something
a: - the actual label "a" ... needed to reset branching conditions

Tb - branch to label b if previous expression matched something
x - swap pattern space and hold space
s/^/1/ - insert "1" into the pattern space
x - swap pattern space and hold space
:b - the actual label "b'

$ - only match the last line (it's an address match)
p - print current pattern space
x - swap pattern space and hold space
/^0/Q1;Q0 - if the pattern space starts with a 0, exit with 1 ... otherwise 
continue on to the exit with 0 ... either way, quit without printing

the optional argument to Q is a GNU extension which isnt documented in the 
manpage :( ... guess i'll send them a patch

pretty sure the first expression can be dropped:
sed -e 's/$STRING/$REPLACEMENT/' \
-e 'tb;x;s/^/1/;x;:b;${p;x;/^$/Q1;Q0};'

and the printing makes it a little reliant on how sed is used ... i think 
something like this should work with -n:
-e 'Tb;x;s/^/1/;x;:b;${x;/^$/{x;q1};x;q0}'
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Donnie Berkholz
On 00:02 Wed 26 Sep , Stephen Bennett wrote:
> On Tue, 25 Sep 2007 11:10:34 +0200
> Robert Buchholz <[EMAIL PROTECTED]> wrote:
> 
> > I already wondered a while back:
> > sed only fails if the file does not exist, but not if there was no 
> > replacement. Is there any way to force it to?
> 
> Off the top of my head...
> 
> sed -e '1{x;s/^/0/;x;ta;:a}'
> -e 's/$STRING/$REPLACEMENT/'
> -e 'Tb;x;s/^/1/;x;:b;${p;x;/^0/Q1;Q0};'

I spent a few minutes trying to decipher that without luck. Could you 
walk me through it?

Thanks,
Donnie
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Donnie Berkholz
On 10:16 Tue 25 Sep , Doug Goldstein wrote:
> Donnie Berkholz wrote:
> > On 20:04 Mon 24 Sep , Doug Goldstein (cardoe) wrote:
> >   
> >> cardoe  07/09/24 20:04:55
> >>
> >>   Modified: ChangeLog
> >>   Added:linuxtv-dvb-apps-1.1.1.20070924.ebuild
> >>   Log:
> >>   latest upstream snapshot. Includes many scan file updates. Drops 
> >> duplicate installs of scan files in /usr/share/dvb.
> >>   (Portage version: 2.1.3.9)

> I simply cp'd the previous revision to the new revision so it would pull
> now a newer upstream tarball then one from middle January. File a bug
> with the maintainers.

I feel a responsibility to commit the best, most bug-free code I can, 
regardless of whether I created the bug. Don't you?

Thanks,
Donnie
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Stephen Bennett
On Tue, 25 Sep 2007 11:10:34 +0200
Robert Buchholz <[EMAIL PROTECTED]> wrote:

> I already wondered a while back:
> sed only fails if the file does not exist, but not if there was no 
> replacement. Is there any way to force it to?

Off the top of my head...

sed -e '1{x;s/^/0/;x;ta;:a}'
-e 's/$STRING/$REPLACEMENT/'
-e 'Tb;x;s/^/1/;x;:b;${p;x;/^0/Q1;Q0};'
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Mike Frysinger
On Tuesday 25 September 2007, Robert Buchholz wrote:
> On Tuesday, 25. September 2007, Donnie Berkholz wrote:
> > On 20:04 Mon 24 Sep , Doug Goldstein (cardoe) wrote:
> > >   if ! use usb; then
> > >   sed -i util/Makefile \
> > >   -e '/ttusb_dec_reset/d' \
> > >   -e '/dib3000-watch/d'
> > >   fi
> > >
> > >   # do not compile test-progs
> > >   sed -i Makefile -e '/-C test/d'
> >
> > You might want to die if these seds fail.
>
> I already wondered a while back:
> sed only fails if the file does not exist, but not if there was no
> replacement. Is there any way to force it to?

i'm fairly certain the answer is no
-mike


signature.asc
Description: This is a digitally signed message part.


[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Doug Goldstein
Donnie Berkholz wrote:
> On 20:04 Mon 24 Sep , Doug Goldstein (cardoe) wrote:
>   
>> cardoe  07/09/24 20:04:55
>>
>>   Modified: ChangeLog
>>   Added:linuxtv-dvb-apps-1.1.1.20070924.ebuild
>>   Log:
>>   latest upstream snapshot. Includes many scan file updates. Drops duplicate 
>> installs of scan files in /usr/share/dvb.
>>   (Portage version: 2.1.3.9)
>> 
>
>   
>> 1.1  
>> media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild
>>
>> file : 
>> http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild?rev=1.1&view=markup
>> plain: 
>> http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild?rev=1.1&content-type=text/plain
>> 
>
> Numerous instances of D, S, T without quotes.
>
>   
>>  if ! use usb; then
>>  sed -i util/Makefile \
>>  -e '/ttusb_dec_reset/d' \
>>  -e '/dib3000-watch/d'
>>  fi
>>
>>  # do not compile test-progs
>>  sed -i Makefile -e '/-C test/d'
>> 
>
> You might want to die if these seds fail.
>
> Thanks,
> Donnie
>   
I simply cp'd the previous revision to the new revision so it would pull
now a newer upstream tarball then one from middle January. File a bug
with the maintainers.
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-25 Thread Robert Buchholz
On Tuesday, 25. September 2007, Donnie Berkholz wrote:
> On 20:04 Mon 24 Sep , Doug Goldstein (cardoe) wrote:
> > if ! use usb; then
> > sed -i util/Makefile \
> > -e '/ttusb_dec_reset/d' \
> > -e '/dib3000-watch/d'
> > fi
> >
> > # do not compile test-progs
> > sed -i Makefile -e '/-C test/d'
>
> You might want to die if these seds fail.

I already wondered a while back:
sed only fails if the file does not exist, but not if there was no 
replacement. Is there any way to force it to?

Regards,
Robert


signature.asc
Description: This is a digitally signed message part.


[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in media-tv/linuxtv-dvb-apps: ChangeLog linuxtv-dvb-apps-1.1.1.20070924.ebuild

2007-09-24 Thread Donnie Berkholz
On 20:04 Mon 24 Sep , Doug Goldstein (cardoe) wrote:
> cardoe  07/09/24 20:04:55
> 
>   Modified: ChangeLog
>   Added:linuxtv-dvb-apps-1.1.1.20070924.ebuild
>   Log:
>   latest upstream snapshot. Includes many scan file updates. Drops duplicate 
> installs of scan files in /usr/share/dvb.
>   (Portage version: 2.1.3.9)

> 1.1  
> media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild
> 
> file : 
> http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild?rev=1.1&view=markup
> plain: 
> http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-tv/linuxtv-dvb-apps/linuxtv-dvb-apps-1.1.1.20070924.ebuild?rev=1.1&content-type=text/plain

Numerous instances of D, S, T without quotes.

>   if ! use usb; then
>   sed -i util/Makefile \
>   -e '/ttusb_dec_reset/d' \
>   -e '/dib3000-watch/d'
>   fi
> 
>   # do not compile test-progs
>   sed -i Makefile -e '/-C test/d'

You might want to die if these seds fail.

Thanks,
Donnie
-- 
[EMAIL PROTECTED] mailing list