gfsd-hackers
[Top][All Lists]
Advanced

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

address@hidden: [gfsd]repost of patch and editing script]


From: Janet Casey
Subject: address@hidden: [gfsd]repost of patch and editing script]
Date: Mon, 15 Oct 2001 14:01:14 -0400

Can we implement this?

Thanks!


Janet Casey
Free Software Foundation
http://www.gnu.org
address@hidden


------- Start of forwarded message -------
Envelope-to: address@hidden
From: Brian Gough <address@hidden>
To:  address@hidden
Subject: [gfsd]repost of patch and editing script
Sender: address@hidden
X-BeenThere: address@hidden
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:address@hidden>
List-Post: <mailto:address@hidden>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/gfsd-hackers>,
        <mailto:address@hidden>
List-Id: GNU Free Software Directory hackers <gfsd-hackers.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/gfsd-hackers>,
        <mailto:address@hidden>
List-Archive: <http://mail.gnu.org/pipermail/gfsd-hackers/>
Date: Wed, 10 Oct 2001 16:57:42 +0100 (BST)

Hi, a while back I sent a mail to address@hidden with a patch to
Package.pm and a prototype CGI script for editing the directory
entries.  I haven't hear anything back so far.  The original mail is
below.  Could someone let me know if this is the right place to send
it or if it should go somewhere else. 
Thanks.

Brian Gough


- ----------------------------------------------------------------------
From: Brian Gough <address@hidden>
To: address@hidden
Subject: cgi script


I have written a small prototype script for editing Free Software
Directory entries via the web.

At the moment it just creates a form and displays the submitted input.

The script is available for downloading at
http://www.network-theory.co.uk/cgi-edit.pl.txt

It will display an existing entry for editing using a ?package=NAME
cgi argument in the URL.  Otherwise it will give a blank form for a
new entry.

>From reading the archives of the list I saw that the plan is to have
the results sent by email and then incorporated into CVS after manual
inspection.  

If the cgi-script made a 'diff' and emailed it to
address@hidden would this be the best way to do this, rather
than dealing with whole files?  This would make it possible to combine
several independent changes, and would also be easier to inspect.  

An emacs macro could be used to apply the patch directly from the
email with a single key press. The form could have an extra space for
a check-in message provided by the user, also their email address,
which could go into the mail and be processed automatically too
(e.g. to send them a 'thank-you' message when it is commited).

The use of the external diff command from the cgi script would need
some care from a security point of view, but I think it is manageable.

Let me know if this sounds reasonable.

regards
Brian Gough

p.s. I needed to make a couple of patches to GNU/Directory/Package.pm
for this purpose (attached below).  They were,

- -- return undef instead of "not found."  for missing field.

- -- modified the regexp in FETCH to match %%fields at the very
beginning or end of the file.

- -- modified the regexp in FIRSTKEY to match %%fields containing spaces
(some of them do).


Index: GNU/Directory/Package.pm
===================================================================
RCS file: /cvsroot/gnulist/gnulist/GNU/Directory/Package.pm,v
retrieving revision 1.1
diff -c -r1.1 Package.pm
*** GNU/Directory/Package.pm    2001/08/05 07:52:11     1.1
- --- GNU/Directory/Package.pm  2001/09/03 21:02:31
***************
*** 20,29 ****
        my @lines = <FILE>;
        my $file = join('',@lines);
        close(FILE);
!       if ($file =~ /\n%%$key\:\s?(.*?)\n%%/s)
        {
!               return $1;
!       } else { return "not found." }
  }
  
  sub EXISTS
- --- 20,29 ----
        my @lines = <FILE>;
        my $file = join('',@lines);
        close(FILE);
!       if ($file =~ /(^|\n)%%$key\:\s?(.*?)(\n%%|$)/s)
        {
!               return $2;
!       } else { return undef }
  }
  
  sub EXISTS
***************
*** 50,56 ****
        $self->[1] = [];        
        for $i (<FILE>)
        {
!               if ($i =~ /^%%([\w-]+):/) {
                        push @{$self->[1]}, $1;
                }
        }
- --- 50,56 ----
        $self->[1] = [];        
        for $i (<FILE>)
        {
!               if ($i =~ /^%%([^:]+):/) {
                        push @{$self->[1]}, $1;
                }
        }

_______________________________________________
gfsd-hackers mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/gfsd-hackers
------- End of forwarded message -------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]