unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add procmail
@ 2016-02-27  9:16 Lukas Gradl
  2016-02-29 13:54 ` Andy Wingo
  2016-02-29 19:50 ` Leo Famulari
  0 siblings, 2 replies; 7+ messages in thread
From: Lukas Gradl @ 2016-02-27  9:16 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]


Hello Guix!

Attached is a patch to add the mail delivery agent Procmail.

I am new to Guix and Scheme, so I would very much welcome any comments
you might have. 
Thanks in advance!

Best,
Lukas


[-- Attachment #2: 0001-gnu-Add-procmail.patch --]
[-- Type: text/plain, Size: 5810 bytes --]

From 862c540938cd16ed20ce8107ff9729e5f24dae09 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Sat, 27 Feb 2016 02:43:57 -0600
Subject: [PATCH] gnu: Add procmail.

* gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file
* gnu-system.am: Add patch
* gnu/packages/mail.scm (procmail): New variable
---
 gnu-system.am                                      |  1 +
 gnu/packages/mail.scm                              | 50 +++++++++++++++++++++
 .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
 3 files changed, 103 insertions(+)
 create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch

diff --git a/gnu-system.am b/gnu-system.am
index 7727bad..c484031 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -658,6 +658,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
   gnu/packages/patches/polkit-drop-test.patch			\
   gnu/packages/patches/portaudio-audacity-compat.patch		\
+  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
   gnu/packages/patches/pt-scotch-build-parallelism.patch	\
   gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
   gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 5a9f420..31b23a1 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1085,4 +1085,54 @@ deliver it in various ways.")
      ;; with that information.
      (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
 
+
+(define-public procmail
+  (package
+    (name "procmail")
+    (version "3.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
+       ;; the following patch fixes an ambiguous definition of
+       ;; getline() in formail.c. The patch is provided by Debian as
+       ;; patch 24
+       (patches
+        (list
+         (search-patch "procmail-ambiguous-getline-debian.patch")))))
+    (arguments
+     `(#:phases (alist-replace
+                 'configure
+                 (lambda _
+                   (substitute* "Makefile"
+                     (("/bin/sh")
+                      (which "sh")))
+                   (substitute* "Makefile"
+                     (("/usr")
+                      (assoc-ref %outputs "out")))
+                   (substitute* "Makefile"
+                     (("/bin/rm")
+                      (which "rm"))))
+                 %standard-phases)
+       #:tests? #f)) ; no tests
+    (build-system gnu-build-system)
+    (inputs `(("glibc" ,glibc)
+              ("exim" ,exim)))
+    (home-page "http://www.procmail.org/")
+    (synopsis "Versatile mail delivery agent (MDA)")
+    (description "Procmail is a mail delivery agent (MDA) featuring support
+for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
+can be sorted into separate files/directories and arbitrary commands can be
+executed on mail arrival.  Procmail is considered stable, but is no longer
+maintained.")
+    (license gpl2+))) ; procmail allows to choose the
+                      ; nonfree Artistic License 1.0
+                      ; as alternative to the GPL2+.
+                      ; This option is not listed here.
 ;;; mail.scm ends here
diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
new file mode 100644
index 0000000..63bf258
--- /dev/null
+++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
@@ -0,0 +1,52 @@
+--- a/src/fields.c
++++ b/src/fields.c
+@@ -110,16 +110,16 @@
+ 		    /* try and append one valid field to rdheader from stdin */
+ int readhead P((void))
+ { int idlen;
+-  getline();
++  procmail_getline();
+   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
+      return 0;
+   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
+    { if(rdheader)
+ 	return 0;			       /* the From_ line was a fake! */
+-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
+    }
+   else
+-     for(;;getline())		      /* get the rest of the continued field */
++     for(;;procmail_getline())		      /* get the rest of the continued field */
+       { switch(buflast)			     /* will this line be continued? */
+ 	 { case ' ':case '\t':				  /* yep, it sure is */
+ 	      continue;
+--- a/src/formail.c
++++ b/src/formail.c
+@@ -819,7 +819,7 @@
+       { if(split)		       /* gobble up the next start separator */
+ 	 { buffilled=0;
+ #ifdef sMAILBOX_SEPARATOR
+-	   getline();buffilled=0;		 /* but only if it's defined */
++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
+ #endif
+ 	   if(buflast!=EOF)					   /* if any */
+ 	      goto splitit;
+--- a/src/formisc.c
++++ b/src/formisc.c
+@@ -115,7 +115,7 @@
+   buf[buffilled++]=c;
+ }
+ 
+-int getline P((void))			   /* read a newline-terminated line */
++int procmail_getline P((void))			   /* read a newline-terminated line */
+ { if(buflast==EOF)			 /* at the end of our Latin already? */
+    { loadchar('\n');					  /* fake empty line */
+      return EOF;					  /* spread the word */
+--- a/src/formisc.h
++++ b/src/formisc.h
+@@ -17,4 +17,4 @@
+ char*
+  skipwords P((char*start));
+ int
+- getline P((void));
++ procmail_getline P((void));
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-02-27  9:16 [PATCH] Add procmail Lukas Gradl
@ 2016-02-29 13:54 ` Andy Wingo
  2016-03-01  4:35   ` Lukas Gradl
  2016-02-29 19:50 ` Leo Famulari
  1 sibling, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2016-02-29 13:54 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

Hi Lukas,

On Sat 27 Feb 2016 10:16, Lukas Gradl <lgradl@openmailbox.org> writes:

> I am new to Guix and Scheme, so I would very much welcome any comments
> you might have.

Welcome :)

> +       ;; the following patch fixes an ambiguous definition of
> +       ;; getline() in formail.c. The patch is provided by Debian as
> +       ;; patch 24

We tend to prefer full sentences in comments like this one, including
ending punctuation.  Also as a GNU-ism, we are in the church of
two-spaces-after-full-stops :)

> +    (arguments
> +     `(#:phases (alist-replace
> +                 'configure
> +                 (lambda _
> +                   (substitute* "Makefile"
> +                     (("/bin/sh")
> +                      (which "sh")))
> +                   (substitute* "Makefile"
> +                     (("/usr")
> +                      (assoc-ref %outputs "out")))
> +                   (substitute* "Makefile"
> +                     (("/bin/rm")
> +                      (which "rm"))))
> +                 %standard-phases)

There are many packages that still use this syntax, but the current
Best Practice™ is to use `modify-phases'.  Search Guix for some
examples.  Also, substitute* can do all these clauses in one:

  (substitute* "Makefile"
    (("/bin/sh")
     (which "sh"))
    (("/usr")
     (assoc-ref %outputs "out"))
    (("/bin/rm")
     (which "rm")))

The * in substitute* is like the * in let*, meaning the substitutions
will be done in order.  Also, the return value of substitute* is
unspecified (see the Guile manual for more), so be sure to return a true
value from this lambda by just ending the lambda with #t.

> +       #:tests? #f)) ; no tests

Please mention why the tests are disabled.

> +    (build-system gnu-build-system)
> +    (inputs `(("glibc" ,glibc)
> +              ("exim" ,exim)))
> +    (home-page "http://www.procmail.org/")
> +    (synopsis "Versatile mail delivery agent (MDA)")
> +    (description "Procmail is a mail delivery agent (MDA) featuring support
> +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> +can be sorted into separate files/directories and arbitrary commands can be
> +executed on mail arrival.  Procmail is considered stable, but is no longer
> +maintained.")
> +    (license gpl2+))) ; procmail allows to choose the
> +                      ; nonfree Artistic License 1.0
> +                      ; as alternative to the GPL2+.
> +                      ; This option is not listed here.

This sort of a comment is best done as a two-semicolon comment, I think.

Looking pretty good!

Andy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-02-27  9:16 [PATCH] Add procmail Lukas Gradl
  2016-02-29 13:54 ` Andy Wingo
@ 2016-02-29 19:50 ` Leo Famulari
  2016-03-01  4:41   ` Lukas Gradl
  1 sibling, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-02-29 19:50 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Sat, Feb 27, 2016 at 03:16:38AM -0600, Lukas Gradl wrote:
> 
> Hello Guix!
> 
> Attached is a patch to add the mail delivery agent Procmail.
> 
> I am new to Guix and Scheme, so I would very much welcome any comments
> you might have. 
> Thanks in advance!
> 
> Best,
> Lukas
> 

> From 862c540938cd16ed20ce8107ff9729e5f24dae09 Mon Sep 17 00:00:00 2001
> From: Lukas Gradl <lgradl@openmailbox.org>
> Date: Sat, 27 Feb 2016 02:43:57 -0600
> Subject: [PATCH] gnu: Add procmail.
> 
> * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file
> * gnu-system.am: Add patch
> * gnu/packages/mail.scm (procmail): New variable

A few more minor comments. When adding a patch to gnu-system.am, we
specify that we are adding the patch to (dist_patch_DATA). Also, we give
the name of the new variable. There's a good example in commit
c4a7904c2.

Thanks for this worthy addition! Can you send an updated patch
incorporating the changes requested by me and Andy?

> ---
>  gnu-system.am                                      |  1 +
>  gnu/packages/mail.scm                              | 50 +++++++++++++++++++++
>  .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
>  3 files changed, 103 insertions(+)
>  create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> 
> diff --git a/gnu-system.am b/gnu-system.am
> index 7727bad..c484031 100644
> --- a/gnu-system.am
> +++ b/gnu-system.am
> @@ -658,6 +658,7 @@ dist_patch_DATA =						\
>    gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
>    gnu/packages/patches/polkit-drop-test.patch			\
>    gnu/packages/patches/portaudio-audacity-compat.patch		\
> +  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
>    gnu/packages/patches/pt-scotch-build-parallelism.patch	\
>    gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
>    gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 5a9f420..31b23a1 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -1085,4 +1085,54 @@ deliver it in various ways.")
>       ;; with that information.
>       (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
>  
> +
> +(define-public procmail
> +  (package
> +    (name "procmail")
> +    (version "3.22")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
> +             version
> +             ".tar.gz"))
> +       (sha256
> +        (base32
> +         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
> +       ;; the following patch fixes an ambiguous definition of
> +       ;; getline() in formail.c. The patch is provided by Debian as
> +       ;; patch 24
> +       (patches
> +        (list
> +         (search-patch "procmail-ambiguous-getline-debian.patch")))))
> +    (arguments
> +     `(#:phases (alist-replace
> +                 'configure
> +                 (lambda _
> +                   (substitute* "Makefile"
> +                     (("/bin/sh")
> +                      (which "sh")))
> +                   (substitute* "Makefile"
> +                     (("/usr")
> +                      (assoc-ref %outputs "out")))
> +                   (substitute* "Makefile"
> +                     (("/bin/rm")
> +                      (which "rm"))))
> +                 %standard-phases)
> +       #:tests? #f)) ; no tests
> +    (build-system gnu-build-system)
> +    (inputs `(("glibc" ,glibc)
> +              ("exim" ,exim)))
> +    (home-page "http://www.procmail.org/")
> +    (synopsis "Versatile mail delivery agent (MDA)")
> +    (description "Procmail is a mail delivery agent (MDA) featuring support
> +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> +can be sorted into separate files/directories and arbitrary commands can be
> +executed on mail arrival.  Procmail is considered stable, but is no longer
> +maintained.")
> +    (license gpl2+))) ; procmail allows to choose the
> +                      ; nonfree Artistic License 1.0
> +                      ; as alternative to the GPL2+.
> +                      ; This option is not listed here.
>  ;;; mail.scm ends here
> diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> new file mode 100644
> index 0000000..63bf258
> --- /dev/null
> +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> @@ -0,0 +1,52 @@
> +--- a/src/fields.c
> ++++ b/src/fields.c
> +@@ -110,16 +110,16 @@
> + 		    /* try and append one valid field to rdheader from stdin */
> + int readhead P((void))
> + { int idlen;
> +-  getline();
> ++  procmail_getline();
> +   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
> +      return 0;
> +   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
> +    { if(rdheader)
> + 	return 0;			       /* the From_ line was a fake! */
> +-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
> ++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
> +    }
> +   else
> +-     for(;;getline())		      /* get the rest of the continued field */
> ++     for(;;procmail_getline())		      /* get the rest of the continued field */
> +       { switch(buflast)			     /* will this line be continued? */
> + 	 { case ' ':case '\t':				  /* yep, it sure is */
> + 	      continue;
> +--- a/src/formail.c
> ++++ b/src/formail.c
> +@@ -819,7 +819,7 @@
> +       { if(split)		       /* gobble up the next start separator */
> + 	 { buffilled=0;
> + #ifdef sMAILBOX_SEPARATOR
> +-	   getline();buffilled=0;		 /* but only if it's defined */
> ++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
> + #endif
> + 	   if(buflast!=EOF)					   /* if any */
> + 	      goto splitit;
> +--- a/src/formisc.c
> ++++ b/src/formisc.c
> +@@ -115,7 +115,7 @@
> +   buf[buffilled++]=c;
> + }
> + 
> +-int getline P((void))			   /* read a newline-terminated line */
> ++int procmail_getline P((void))			   /* read a newline-terminated line */
> + { if(buflast==EOF)			 /* at the end of our Latin already? */
> +    { loadchar('\n');					  /* fake empty line */
> +      return EOF;					  /* spread the word */
> +--- a/src/formisc.h
> ++++ b/src/formisc.h
> +@@ -17,4 +17,4 @@
> + char*
> +  skipwords P((char*start));
> + int
> +- getline P((void));
> ++ procmail_getline P((void));
> -- 
> 2.6.3
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-02-29 13:54 ` Andy Wingo
@ 2016-03-01  4:35   ` Lukas Gradl
  0 siblings, 0 replies; 7+ messages in thread
From: Lukas Gradl @ 2016-03-01  4:35 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guix-devel

On Mon, Feb 29, 2016 at 02:54:09PM +0100, Andy Wingo wrote:
> Hi Lukas,
> 
> On Sat 27 Feb 2016 10:16, Lukas Gradl <lgradl@openmailbox.org> writes:
> 
> > I am new to Guix and Scheme, so I would very much welcome any comments
> > you might have.
> 
> Welcome :)

Thank you!

> 
> > +       ;; the following patch fixes an ambiguous definition of
> > +       ;; getline() in formail.c. The patch is provided by Debian as
> > +       ;; patch 24
> 
> We tend to prefer full sentences in comments like this one, including
> ending punctuation.  Also as a GNU-ism, we are in the church of
> two-spaces-after-full-stops :)
>

OK, sounds good. Fixed.

> > +    (arguments
> > +     `(#:phases (alist-replace
> > +                 'configure
> > +                 (lambda _
> > +                   (substitute* "Makefile"
> > +                     (("/bin/sh")
> > +                      (which "sh")))
> > +                   (substitute* "Makefile"
> > +                     (("/usr")
> > +                      (assoc-ref %outputs "out")))
> > +                   (substitute* "Makefile"
> > +                     (("/bin/rm")
> > +                      (which "rm"))))
> > +                 %standard-phases)
> 
> There are many packages that still use this syntax, but the current
> Best Practice™ is to use `modify-phases'.  Search Guix for some
> examples.

I changed the patch to use 'modify-phases'. Thanks for pointing this
out, I like this much better than the 'alist-replace'!

> Also, substitute* can do all these clauses in one:
> 
>   (substitute* "Makefile"
>     (("/bin/sh")
>      (which "sh"))
>     (("/usr")
>      (assoc-ref %outputs "out"))
>     (("/bin/rm")
>      (which "rm")))
> 
> The * in substitute* is like the * in let*, meaning the substitutions
> will be done in order.  Also, the return value of substitute* is
> unspecified (see the Guile manual for more), so be sure to return a true
> value from this lambda by just ending the lambda with #t.
>

I updated this. Thank you for the explanation!

> > +       #:tests? #f)) ; no tests
> 
> Please mention why the tests are disabled.

I think procmail comes without tests.  There are no targets like 'tests'
or 'check' in the Makefile.  However, it does perform some test during
'make install' to verify if the filesystem has locking
capabilities.  These are performed before the actual build, so they do
not check if the build was successful.  I changed the comment to better
explain the situation.

> 
> > +    (build-system gnu-build-system)
> > +    (inputs `(("glibc" ,glibc)
> > +              ("exim" ,exim)))
> > +    (home-page "http://www.procmail.org/")
> > +    (synopsis "Versatile mail delivery agent (MDA)")
> > +    (description "Procmail is a mail delivery agent (MDA) featuring support
> > +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> > +can be sorted into separate files/directories and arbitrary commands can be
> > +executed on mail arrival.  Procmail is considered stable, but is no longer
> > +maintained.")
> > +    (license gpl2+))) ; procmail allows to choose the
> > +                      ; nonfree Artistic License 1.0
> > +                      ; as alternative to the GPL2+.
> > +                      ; This option is not listed here.
> 
> This sort of a comment is best done as a two-semicolon comment, I think.
> 
> Looking pretty good!
>

Thank you! This was the last thing keeping me from switching to GuixSD.

I will send an updated patch shortly.

Thank you for your review!

Best,
Lukas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-02-29 19:50 ` Leo Famulari
@ 2016-03-01  4:41   ` Lukas Gradl
  2016-03-03  1:46     ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Gradl @ 2016-03-01  4:41 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 7285 bytes --]

On Mon, Feb 29, 2016 at 02:50:19PM -0500, Leo Famulari wrote:
> On Sat, Feb 27, 2016 at 03:16:38AM -0600, Lukas Gradl wrote:
> > 
> > Hello Guix!
> > 
> > Attached is a patch to add the mail delivery agent Procmail.
> > 
> > I am new to Guix and Scheme, so I would very much welcome any comments
> > you might have. 
> > Thanks in advance!
> > 
> > Best,
> > Lukas
> > 
> 
> > From 862c540938cd16ed20ce8107ff9729e5f24dae09 Mon Sep 17 00:00:00 2001
> > From: Lukas Gradl <lgradl@openmailbox.org>
> > Date: Sat, 27 Feb 2016 02:43:57 -0600
> > Subject: [PATCH] gnu: Add procmail.
> > 
> > * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file
> > * gnu-system.am: Add patch
> > * gnu/packages/mail.scm (procmail): New variable
> 
> A few more minor comments. When adding a patch to gnu-system.am, we
> specify that we are adding the patch to (dist_patch_DATA). Also, we give
> the name of the new variable. There's a good example in commit
> c4a7904c2.

I upaded this and added a full-stop at the end of each line.
Thank you for pointing this out!


> 
> Thanks for this worthy addition! Can you send an updated patch
> incorporating the changes requested by me and Andy?

A new patch is attached. Thanks for the review!

Best,
Lukas

> 
> > ---
> >  gnu-system.am                                      |  1 +
> >  gnu/packages/mail.scm                              | 50 +++++++++++++++++++++
> >  .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
> >  3 files changed, 103 insertions(+)
> >  create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > 
> > diff --git a/gnu-system.am b/gnu-system.am
> > index 7727bad..c484031 100644
> > --- a/gnu-system.am
> > +++ b/gnu-system.am
> > @@ -658,6 +658,7 @@ dist_patch_DATA =						\
> >    gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
> >    gnu/packages/patches/polkit-drop-test.patch			\
> >    gnu/packages/patches/portaudio-audacity-compat.patch		\
> > +  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
> >    gnu/packages/patches/pt-scotch-build-parallelism.patch	\
> >    gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
> >    gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
> > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> > index 5a9f420..31b23a1 100644
> > --- a/gnu/packages/mail.scm
> > +++ b/gnu/packages/mail.scm
> > @@ -1085,4 +1085,54 @@ deliver it in various ways.")
> >       ;; with that information.
> >       (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
> >  
> > +
> > +(define-public procmail
> > +  (package
> > +    (name "procmail")
> > +    (version "3.22")
> > +    (source
> > +     (origin
> > +       (method url-fetch)
> > +       (uri (string-append
> > +             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
> > +             version
> > +             ".tar.gz"))
> > +       (sha256
> > +        (base32
> > +         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
> > +       ;; the following patch fixes an ambiguous definition of
> > +       ;; getline() in formail.c. The patch is provided by Debian as
> > +       ;; patch 24
> > +       (patches
> > +        (list
> > +         (search-patch "procmail-ambiguous-getline-debian.patch")))))
> > +    (arguments
> > +     `(#:phases (alist-replace
> > +                 'configure
> > +                 (lambda _
> > +                   (substitute* "Makefile"
> > +                     (("/bin/sh")
> > +                      (which "sh")))
> > +                   (substitute* "Makefile"
> > +                     (("/usr")
> > +                      (assoc-ref %outputs "out")))
> > +                   (substitute* "Makefile"
> > +                     (("/bin/rm")
> > +                      (which "rm"))))
> > +                 %standard-phases)
> > +       #:tests? #f)) ; no tests
> > +    (build-system gnu-build-system)
> > +    (inputs `(("glibc" ,glibc)
> > +              ("exim" ,exim)))
> > +    (home-page "http://www.procmail.org/")
> > +    (synopsis "Versatile mail delivery agent (MDA)")
> > +    (description "Procmail is a mail delivery agent (MDA) featuring support
> > +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> > +can be sorted into separate files/directories and arbitrary commands can be
> > +executed on mail arrival.  Procmail is considered stable, but is no longer
> > +maintained.")
> > +    (license gpl2+))) ; procmail allows to choose the
> > +                      ; nonfree Artistic License 1.0
> > +                      ; as alternative to the GPL2+.
> > +                      ; This option is not listed here.
> >  ;;; mail.scm ends here
> > diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > new file mode 100644
> > index 0000000..63bf258
> > --- /dev/null
> > +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > @@ -0,0 +1,52 @@
> > +--- a/src/fields.c
> > ++++ b/src/fields.c
> > +@@ -110,16 +110,16 @@
> > + 		    /* try and append one valid field to rdheader from stdin */
> > + int readhead P((void))
> > + { int idlen;
> > +-  getline();
> > ++  procmail_getline();
> > +   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
> > +      return 0;
> > +   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
> > +    { if(rdheader)
> > + 	return 0;			       /* the From_ line was a fake! */
> > +-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
> > ++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
> > +    }
> > +   else
> > +-     for(;;getline())		      /* get the rest of the continued field */
> > ++     for(;;procmail_getline())		      /* get the rest of the continued field */
> > +       { switch(buflast)			     /* will this line be continued? */
> > + 	 { case ' ':case '\t':				  /* yep, it sure is */
> > + 	      continue;
> > +--- a/src/formail.c
> > ++++ b/src/formail.c
> > +@@ -819,7 +819,7 @@
> > +       { if(split)		       /* gobble up the next start separator */
> > + 	 { buffilled=0;
> > + #ifdef sMAILBOX_SEPARATOR
> > +-	   getline();buffilled=0;		 /* but only if it's defined */
> > ++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
> > + #endif
> > + 	   if(buflast!=EOF)					   /* if any */
> > + 	      goto splitit;
> > +--- a/src/formisc.c
> > ++++ b/src/formisc.c
> > +@@ -115,7 +115,7 @@
> > +   buf[buffilled++]=c;
> > + }
> > + 
> > +-int getline P((void))			   /* read a newline-terminated line */
> > ++int procmail_getline P((void))			   /* read a newline-terminated line */
> > + { if(buflast==EOF)			 /* at the end of our Latin already? */
> > +    { loadchar('\n');					  /* fake empty line */
> > +      return EOF;					  /* spread the word */
> > +--- a/src/formisc.h
> > ++++ b/src/formisc.h
> > +@@ -17,4 +17,4 @@
> > + char*
> > +  skipwords P((char*start));
> > + int
> > +- getline P((void));
> > ++ procmail_getline P((void));
> > -- 
> > 2.6.3
> > 
> 

-- 
Lukas Gradl			
 Email:	lgradl@openmailbox.org
fingerprint: 
 2F07 6B84 2704 B631 B8D3  6C0E A49D 050F AC97 11C1
You won't find me on Facebook

[-- Attachment #2: 0001-gnu-Add-procmail.patch --]
[-- Type: text/plain, Size: 5879 bytes --]

From 959dbec07bb2509c9c997ac02cef55bedc53e005 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Mon, 29 Feb 2016 22:07:35 -0600
Subject: [PATCH] gnu: Add procmail.

 * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file.
 * gnu-system.am (dist_patch_DATA): Add it.
 * gnu/packages/mail.scm (procmail): New variable.
---
 gnu-system.am                                      |  1 +
 gnu/packages/mail.scm                              | 52 ++++++++++++++++++++++
 .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
 3 files changed, 105 insertions(+)
 create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch

diff --git a/gnu-system.am b/gnu-system.am
index 7727bad..c484031 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -658,6 +658,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
   gnu/packages/patches/polkit-drop-test.patch			\
   gnu/packages/patches/portaudio-audacity-compat.patch		\
+  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
   gnu/packages/patches/pt-scotch-build-parallelism.patch	\
   gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
   gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 5a9f420..cbb1271 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1085,4 +1085,56 @@ deliver it in various ways.")
      ;; with that information.
      (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
 
+
+(define-public procmail
+  (package
+    (name "procmail")
+    (version "3.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
+       ;; The following patch fixes an ambiguous definition of
+       ;; getline() in formail.c.  The patch is provided by Debian as
+       ;; patch 24.
+       (patches
+        (list
+         (search-patch "procmail-ambiguous-getline-debian.patch")))))
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda _
+                      (substitute* "Makefile"
+                        (("/bin/sh")
+                         (which "sh"))
+                        (("/usr")
+                         (assoc-ref %outputs "out"))
+                        (("/bin/rm")
+                         (which "rm")))
+                      #t)))
+       #:tests? #f)) ;; There are no tests indicating a successful
+    ;; build.  Some tests of basic locking mechanisms provided by the
+    ;; filesystem are performed during 'make install'.  However, these
+    ;; are performed before the actual build process.
+    (build-system gnu-build-system)
+    (inputs `(("glibc" ,glibc)
+              ("exim" ,exim)))
+    (home-page "http://www.procmail.org/")
+    (synopsis "Versatile mail delivery agent (MDA)")
+    (description "Procmail is a mail delivery agent (MDA) featuring support
+for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
+can be sorted into separate files/directories and arbitrary commands can be
+executed on mail arrival.  Procmail is considered stable, but is no longer
+maintained.")
+    (license gpl2+))) ;; procmail allows to choose the
+                      ;; nonfree Artistic License 1.0
+                      ;; as alternative to the GPL2+.
+                      ;; This option is not listed here.
 ;;; mail.scm ends here
+
diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
new file mode 100644
index 0000000..63bf258
--- /dev/null
+++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
@@ -0,0 +1,52 @@
+--- a/src/fields.c
++++ b/src/fields.c
+@@ -110,16 +110,16 @@
+ 		    /* try and append one valid field to rdheader from stdin */
+ int readhead P((void))
+ { int idlen;
+-  getline();
++  procmail_getline();
+   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
+      return 0;
+   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
+    { if(rdheader)
+ 	return 0;			       /* the From_ line was a fake! */
+-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
+    }
+   else
+-     for(;;getline())		      /* get the rest of the continued field */
++     for(;;procmail_getline())		      /* get the rest of the continued field */
+       { switch(buflast)			     /* will this line be continued? */
+ 	 { case ' ':case '\t':				  /* yep, it sure is */
+ 	      continue;
+--- a/src/formail.c
++++ b/src/formail.c
+@@ -819,7 +819,7 @@
+       { if(split)		       /* gobble up the next start separator */
+ 	 { buffilled=0;
+ #ifdef sMAILBOX_SEPARATOR
+-	   getline();buffilled=0;		 /* but only if it's defined */
++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
+ #endif
+ 	   if(buflast!=EOF)					   /* if any */
+ 	      goto splitit;
+--- a/src/formisc.c
++++ b/src/formisc.c
+@@ -115,7 +115,7 @@
+   buf[buffilled++]=c;
+ }
+ 
+-int getline P((void))			   /* read a newline-terminated line */
++int procmail_getline P((void))			   /* read a newline-terminated line */
+ { if(buflast==EOF)			 /* at the end of our Latin already? */
+    { loadchar('\n');					  /* fake empty line */
+      return EOF;					  /* spread the word */
+--- a/src/formisc.h
++++ b/src/formisc.h
+@@ -17,4 +17,4 @@
+ char*
+  skipwords P((char*start));
+ int
+- getline P((void));
++ procmail_getline P((void));
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-03-01  4:41   ` Lukas Gradl
@ 2016-03-03  1:46     ` Leo Famulari
  2016-03-03  2:59       ` Lukas Gradl
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-03-03  1:46 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Mon, Feb 29, 2016 at 10:41:12PM -0600, Lukas Gradl wrote:

[...]

> > > * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file
> > > * gnu-system.am: Add patch
> > > * gnu/packages/mail.scm (procmail): New variable

[...]

> A new patch is attached. Thanks for the review!

I added a copyright line for you and some context for the patch, and
pushed as e90819c40af.

Thank you!

> 
> Best,
> Lukas
> 
> > 
> > > ---
> > >  gnu-system.am                                      |  1 +
> > >  gnu/packages/mail.scm                              | 50 +++++++++++++++++++++
> > >  .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
> > >  3 files changed, 103 insertions(+)
> > >  create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > > 
> > > diff --git a/gnu-system.am b/gnu-system.am
> > > index 7727bad..c484031 100644
> > > --- a/gnu-system.am
> > > +++ b/gnu-system.am
> > > @@ -658,6 +658,7 @@ dist_patch_DATA =						\
> > >    gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
> > >    gnu/packages/patches/polkit-drop-test.patch			\
> > >    gnu/packages/patches/portaudio-audacity-compat.patch		\
> > > +  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
> > >    gnu/packages/patches/pt-scotch-build-parallelism.patch	\
> > >    gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
> > >    gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
> > > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> > > index 5a9f420..31b23a1 100644
> > > --- a/gnu/packages/mail.scm
> > > +++ b/gnu/packages/mail.scm
> > > @@ -1085,4 +1085,54 @@ deliver it in various ways.")
> > >       ;; with that information.
> > >       (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
> > >  
> > > +
> > > +(define-public procmail
> > > +  (package
> > > +    (name "procmail")
> > > +    (version "3.22")
> > > +    (source
> > > +     (origin
> > > +       (method url-fetch)
> > > +       (uri (string-append
> > > +             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
> > > +             version
> > > +             ".tar.gz"))
> > > +       (sha256
> > > +        (base32
> > > +         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
> > > +       ;; the following patch fixes an ambiguous definition of
> > > +       ;; getline() in formail.c. The patch is provided by Debian as
> > > +       ;; patch 24
> > > +       (patches
> > > +        (list
> > > +         (search-patch "procmail-ambiguous-getline-debian.patch")))))
> > > +    (arguments
> > > +     `(#:phases (alist-replace
> > > +                 'configure
> > > +                 (lambda _
> > > +                   (substitute* "Makefile"
> > > +                     (("/bin/sh")
> > > +                      (which "sh")))
> > > +                   (substitute* "Makefile"
> > > +                     (("/usr")
> > > +                      (assoc-ref %outputs "out")))
> > > +                   (substitute* "Makefile"
> > > +                     (("/bin/rm")
> > > +                      (which "rm"))))
> > > +                 %standard-phases)
> > > +       #:tests? #f)) ; no tests
> > > +    (build-system gnu-build-system)
> > > +    (inputs `(("glibc" ,glibc)
> > > +              ("exim" ,exim)))
> > > +    (home-page "http://www.procmail.org/")
> > > +    (synopsis "Versatile mail delivery agent (MDA)")
> > > +    (description "Procmail is a mail delivery agent (MDA) featuring support
> > > +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> > > +can be sorted into separate files/directories and arbitrary commands can be
> > > +executed on mail arrival.  Procmail is considered stable, but is no longer
> > > +maintained.")
> > > +    (license gpl2+))) ; procmail allows to choose the
> > > +                      ; nonfree Artistic License 1.0
> > > +                      ; as alternative to the GPL2+.
> > > +                      ; This option is not listed here.
> > >  ;;; mail.scm ends here
> > > diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > > new file mode 100644
> > > index 0000000..63bf258
> > > --- /dev/null
> > > +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> > > @@ -0,0 +1,52 @@
> > > +--- a/src/fields.c
> > > ++++ b/src/fields.c
> > > +@@ -110,16 +110,16 @@
> > > + 		    /* try and append one valid field to rdheader from stdin */
> > > + int readhead P((void))
> > > + { int idlen;
> > > +-  getline();
> > > ++  procmail_getline();
> > > +   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
> > > +      return 0;
> > > +   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
> > > +    { if(rdheader)
> > > + 	return 0;			       /* the From_ line was a fake! */
> > > +-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
> > > ++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
> > > +    }
> > > +   else
> > > +-     for(;;getline())		      /* get the rest of the continued field */
> > > ++     for(;;procmail_getline())		      /* get the rest of the continued field */
> > > +       { switch(buflast)			     /* will this line be continued? */
> > > + 	 { case ' ':case '\t':				  /* yep, it sure is */
> > > + 	      continue;
> > > +--- a/src/formail.c
> > > ++++ b/src/formail.c
> > > +@@ -819,7 +819,7 @@
> > > +       { if(split)		       /* gobble up the next start separator */
> > > + 	 { buffilled=0;
> > > + #ifdef sMAILBOX_SEPARATOR
> > > +-	   getline();buffilled=0;		 /* but only if it's defined */
> > > ++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
> > > + #endif
> > > + 	   if(buflast!=EOF)					   /* if any */
> > > + 	      goto splitit;
> > > +--- a/src/formisc.c
> > > ++++ b/src/formisc.c
> > > +@@ -115,7 +115,7 @@
> > > +   buf[buffilled++]=c;
> > > + }
> > > + 
> > > +-int getline P((void))			   /* read a newline-terminated line */
> > > ++int procmail_getline P((void))			   /* read a newline-terminated line */
> > > + { if(buflast==EOF)			 /* at the end of our Latin already? */
> > > +    { loadchar('\n');					  /* fake empty line */
> > > +      return EOF;					  /* spread the word */
> > > +--- a/src/formisc.h
> > > ++++ b/src/formisc.h
> > > +@@ -17,4 +17,4 @@
> > > + char*
> > > +  skipwords P((char*start));
> > > + int
> > > +- getline P((void));
> > > ++ procmail_getline P((void));
> > > -- 
> > > 2.6.3
> > > 
> > 
> 
> -- 
> Lukas Gradl			
>  Email:	lgradl@openmailbox.org
> fingerprint: 
>  2F07 6B84 2704 B631 B8D3  6C0E A49D 050F AC97 11C1
> You won't find me on Facebook

> From 959dbec07bb2509c9c997ac02cef55bedc53e005 Mon Sep 17 00:00:00 2001
> From: Lukas Gradl <lgradl@openmailbox.org>
> Date: Mon, 29 Feb 2016 22:07:35 -0600
> Subject: [PATCH] gnu: Add procmail.
> 
>  * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file.
>  * gnu-system.am (dist_patch_DATA): Add it.
>  * gnu/packages/mail.scm (procmail): New variable.
> ---
>  gnu-system.am                                      |  1 +
>  gnu/packages/mail.scm                              | 52 ++++++++++++++++++++++
>  .../procmail-ambiguous-getline-debian.patch        | 52 ++++++++++++++++++++++
>  3 files changed, 105 insertions(+)
>  create mode 100644 gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> 
> diff --git a/gnu-system.am b/gnu-system.am
> index 7727bad..c484031 100644
> --- a/gnu-system.am
> +++ b/gnu-system.am
> @@ -658,6 +658,7 @@ dist_patch_DATA =						\
>    gnu/packages/patches/plotutils-libpng-jmpbuf.patch		\
>    gnu/packages/patches/polkit-drop-test.patch			\
>    gnu/packages/patches/portaudio-audacity-compat.patch		\
> +  gnu/packages/patches/procmail-ambiguous-getline-debian.patch  \
>    gnu/packages/patches/pt-scotch-build-parallelism.patch	\
>    gnu/packages/patches/pulseaudio-fix-mult-test.patch		\
>    gnu/packages/patches/pulseaudio-longer-test-timeout.patch	\
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 5a9f420..cbb1271 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -1085,4 +1085,56 @@ deliver it in various ways.")
>       ;; with that information.
>       (non-copyleft "https://github.com/nicm/fdm/blob/master/command.c"))))
>  
> +
> +(define-public procmail
> +  (package
> +    (name "procmail")
> +    (version "3.22")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "ftp://ftp.fu-berlin.de/pub/unix/mail/procmail/procmail-"
> +             version
> +             ".tar.gz"))
> +       (sha256
> +        (base32
> +         "05z1c803n5cppkcq99vkyd5myff904lf9sdgynfqngfk9nrpaz08"))
> +       ;; The following patch fixes an ambiguous definition of
> +       ;; getline() in formail.c.  The patch is provided by Debian as
> +       ;; patch 24.
> +       (patches
> +        (list
> +         (search-patch "procmail-ambiguous-getline-debian.patch")))))
> +    (arguments
> +     `(#:phases (modify-phases %standard-phases
> +                  (replace 'configure
> +                    (lambda _
> +                      (substitute* "Makefile"
> +                        (("/bin/sh")
> +                         (which "sh"))
> +                        (("/usr")
> +                         (assoc-ref %outputs "out"))
> +                        (("/bin/rm")
> +                         (which "rm")))
> +                      #t)))
> +       #:tests? #f)) ;; There are no tests indicating a successful
> +    ;; build.  Some tests of basic locking mechanisms provided by the
> +    ;; filesystem are performed during 'make install'.  However, these
> +    ;; are performed before the actual build process.
> +    (build-system gnu-build-system)
> +    (inputs `(("glibc" ,glibc)
> +              ("exim" ,exim)))
> +    (home-page "http://www.procmail.org/")
> +    (synopsis "Versatile mail delivery agent (MDA)")
> +    (description "Procmail is a mail delivery agent (MDA) featuring support
> +for a variety of mailbox formats such as mbox, mh and maildir.  Incoming mail
> +can be sorted into separate files/directories and arbitrary commands can be
> +executed on mail arrival.  Procmail is considered stable, but is no longer
> +maintained.")
> +    (license gpl2+))) ;; procmail allows to choose the
> +                      ;; nonfree Artistic License 1.0
> +                      ;; as alternative to the GPL2+.
> +                      ;; This option is not listed here.
>  ;;; mail.scm ends here
> +
> diff --git a/gnu/packages/patches/procmail-ambiguous-getline-debian.patch b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> new file mode 100644
> index 0000000..63bf258
> --- /dev/null
> +++ b/gnu/packages/patches/procmail-ambiguous-getline-debian.patch
> @@ -0,0 +1,52 @@
> +--- a/src/fields.c
> ++++ b/src/fields.c
> +@@ -110,16 +110,16 @@
> + 		    /* try and append one valid field to rdheader from stdin */
> + int readhead P((void))
> + { int idlen;
> +-  getline();
> ++  procmail_getline();
> +   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
> +      return 0;
> +   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
> +    { if(rdheader)
> + 	return 0;			       /* the From_ line was a fake! */
> +-     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
> ++     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
> +    }
> +   else
> +-     for(;;getline())		      /* get the rest of the continued field */
> ++     for(;;procmail_getline())		      /* get the rest of the continued field */
> +       { switch(buflast)			     /* will this line be continued? */
> + 	 { case ' ':case '\t':				  /* yep, it sure is */
> + 	      continue;
> +--- a/src/formail.c
> ++++ b/src/formail.c
> +@@ -819,7 +819,7 @@
> +       { if(split)		       /* gobble up the next start separator */
> + 	 { buffilled=0;
> + #ifdef sMAILBOX_SEPARATOR
> +-	   getline();buffilled=0;		 /* but only if it's defined */
> ++	   procmail_getline();buffilled=0;		 /* but only if it's defined */
> + #endif
> + 	   if(buflast!=EOF)					   /* if any */
> + 	      goto splitit;
> +--- a/src/formisc.c
> ++++ b/src/formisc.c
> +@@ -115,7 +115,7 @@
> +   buf[buffilled++]=c;
> + }
> + 
> +-int getline P((void))			   /* read a newline-terminated line */
> ++int procmail_getline P((void))			   /* read a newline-terminated line */
> + { if(buflast==EOF)			 /* at the end of our Latin already? */
> +    { loadchar('\n');					  /* fake empty line */
> +      return EOF;					  /* spread the word */
> +--- a/src/formisc.h
> ++++ b/src/formisc.h
> +@@ -17,4 +17,4 @@
> + char*
> +  skipwords P((char*start));
> + int
> +- getline P((void));
> ++ procmail_getline P((void));
> -- 
> 2.6.3
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add procmail
  2016-03-03  1:46     ` Leo Famulari
@ 2016-03-03  2:59       ` Lukas Gradl
  0 siblings, 0 replies; 7+ messages in thread
From: Lukas Gradl @ 2016-03-03  2:59 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hi Leo,

On Wed, Mar 02, 2016 at 08:46:05PM -0500, Leo Famulari wrote:
> On Mon, Feb 29, 2016 at 10:41:12PM -0600, Lukas Gradl wrote:
> 
> [...]
> 
> > > > * gnu/packages/patches/procmail-ambiguous-getline-debian.patch: New file
> > > > * gnu-system.am: Add patch
> > > > * gnu/packages/mail.scm (procmail): New variable
> 
> [...]
> 
> > A new patch is attached. Thanks for the review!
> 
> I added a copyright line for you and some context for the patch, and
> pushed as e90819c40af.

Thank you for your help!

Best,
Lukas

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-03  2:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27  9:16 [PATCH] Add procmail Lukas Gradl
2016-02-29 13:54 ` Andy Wingo
2016-03-01  4:35   ` Lukas Gradl
2016-02-29 19:50 ` Leo Famulari
2016-03-01  4:41   ` Lukas Gradl
2016-03-03  1:46     ` Leo Famulari
2016-03-03  2:59       ` Lukas Gradl

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).