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

How to mass change something (was: Re: Need help with links to mysql.org)



On Tue, 14 Aug 2001, claviola@debian.org wrote:
> On Mon, Aug 13, 2001 at 01:41:57PM +0300, Tommi Vainikainen wrote:
>> As this page is only translation of why_debian.en.html, which
>> points to mysql.com I've changed this link now, so that all
>> translations should now link to mysql.com instead of .org.
> 
> Usually, how do you do these mass changes? (gotta get some regexp
> experience... *sigh*)

I just run cd webwml; grep -l whatever */intro/why_debian.wml too see
which files need changes.

Then I run for i in `grep -l whatever */example.wml`; do cat <<EOF |
ed $i; done
,s/translation="n"/translation="n+1"/ # this only if \
there are changes in english
,s/oldlink/newlink/
w
q
EOF
cvs diff */example.wml | less (It's rather useful to verify this kind
of mass changes.)
cvs commit -m 'foo' */example.wml (Cvs commits only modified files, so
there is no need use backticks and grep here.)

But this time it was only german that had wrong link (which I checked with
grep), so I did it manually. :-)

> Also, I don't have the whole webwml module checked out, only english
> and portuguese, so perhaps I wouldn't be able to do that myself too,
> right?

Right, you need to check out all languages.  Now it takes about 65MB
in size.  Also cvs update times are longer.

-- 
Tommi Vainikainen



Reply to: