Hi Andreas & Gary,
On 31/01/06, Andreas Gruenbacher <[EMAIL PROTECTED]> wrote:
> On Tuesday 31 January 2006 13:18, Gary V. Vaughan wrote:
> > Andreas Gruenbacher wrote:
> > > There's an instance of ``uniq -D'' in the mail command as well that John
> > > hat trouble with.
> >
> > With the attached patch (and my patch-17 from an earlier mail) applied,
> > quilt passes its testsuite on OSX again. I figured that since we already
> > require parts of coreutils, it was easier to use coreutils uniq (guniq from
> > darwinports) than script a workaround in bash.
>
> Thanks.
afaik quilt has not had a hard dependency on coreutils, except that
mail uses GNU date and uniq features. If possible, could we avoid
this dependency as it is a very large package, or turn the error into
a warning that mail wont work?
The attached patch addresses the uniq side of things, however the
ordering of the patches with duplicate subjects wont be exactly the
same, unless a sort is added back in. Also, I havent had time to test
this on many platforms.
--
John
Index: quilt/mail.in
===================================================================
RCS file: /sources/quilt/quilt/quilt/mail.in,v
retrieving revision 1.17
diff -u -r1.17 mail.in
--- quilt/mail.in 30 Jan 2006 22:57:57 -0000 1.17
+++ quilt/mail.in 31 Jan 2006 14:26:24 -0000
@@ -310,8 +310,15 @@
dup_subjects=( $(
printf "%s\n" "[EMAIL PROTECTED]" \
| sort -k2 \
- | uniq -D -f1 \
- | cut -f1) )
+ | awk '{ patch=$1 ; subject = gensub(/^[^ ]*['$\t' ]*/,"", 1); \
+ if (subject in subjects) { \
+ if (subjects[subject]!=1) \
+ print subjects[subject]; \
+ print " "patch; \
+ subjects[subject] = 1; \
+ } \
+ else subjects[subject]=patch }' \
+ ) )
if [ [EMAIL PROTECTED] -ne 0 ]; then
printf $"Patches %s have duplicate subject headers.\n" \
"$(set -- "${dup_subjects[*]/%/, }"; echo ${1%, })"
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev