chris...

that's sort of what i had thought about. my perl's rusty. the issue i have,
is that the line with the 'svn_roots:' may/will have subsequent lines that
are part of the block. i'd like to be able to add the new information, as
the last line of the block...


.
.
.
#
#file comments...
svn_roots:  foo: /fffff,
            dog: /ggggg,

#continue file
#blah....
.
.
.

in this case, i'd like to be able to add the new line, immediately after the
'dog:' line...

so, i'd need to somehow get the line with 'svn_roots:' and find/determine
the end of the block, and then add the new line...

the viewcvs.conf file is pretty straightforward...

thanks

bruce

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Chris Wagner
Sent: Monday, April 18, 2005 9:59 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: Re: trying to parse a file...


At 07:41 PM 4/17/05 -0700, [EMAIL PROTECTED] wrote:
>it isn't working correctly... and i'm willing to consider using perl.
>basically, i'd like to continually add to the svn_root: block with an
>additional line as required. also, can someone tell me what i'd need to do,
>if i wanted to remove a line of text from the 'svn_root' block if i had a
>given 'test_x:'

Yeah modifying that conf file would be pretty easy in perl.  However I can't
give u any scripting advice until I know what all the conf file encompasses.
If u only care about the svn_root parameter we can just keep reading in
lines and reguritating them until that flag is hit, then modify it, then
reguritate until the end of file.

while ($line = <FILE>) {
        if ($line =~ m/^svn_roots = /) {
                ## We've found it, do some work
                print &modify_somehow($line);
        }
        else {
                ## It's not a line we want, so just regurgitate
                print $line;
        }
}

>-----------------------------------------------------------
>viewcvs.conf:
>  # This setting specifies each of the Subversion roots (repositories)
>  # on your system and assigns names to them. Each root should be given
>  # by a "name: path" value. Multiple roots should be separated by
>  # commas and can be placed on separate lines.
>  #
>  #svn_roots = test2: /svn-gforge/uploadsvn
>  svn_roots = test5: /gforge-svn/test7/svn,
>              test2: /gforge-svn/test7/svn,
>              test3: /gforge-svn/test7/svn,
>





--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede males"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to