Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - A patch for gettext-asprintf: (8 Items)
   
A patch for gettext-asprintf  
Attached is a patch file for gettext-asprintf, version 0.14.6

It is a mod to the file autosprintf.cc.
All I've done is added #include <malloc.h>
The compile failed because free() was not defined.

I think I need some help with this patch file.

The docs say that the first line is for the RCS ID, but I have no idea how to generate one in this situation.

The docs insist that one put in a comment, and I don't know how to do that in a diff -bu file. I can't even find any 
documentation on the -u option.

The docs do not mention how to make this a patch for just QNX. I suppose I could have put in #ifdef QNX but the docs 
insist that you not do this.  

They mention making a change to the configure file so that it checks to see if this is needed, but I have no experience 
in
this area. 

It seems to me that to create a patch file to just to add a #include file should not be that difficult.
Attachment: Text patch-aa 261 bytes
Re: A patch for gettext-asprintf  
You haven't read the 11.3.2, have you? :)

# pkgvi work/<path_to_the_file>
# mkpatches
# cp work/.newpatch/patch-<the_one_I_want patches/
# make makepatchsum
Re: A patch for gettext-asprintf  
> You haven't read the 11.3.2, have you? :)
> 
> # pkgvi work/<path_to_the_file>
> # mkpatches
> # cp work/.newpatch/patch-<the_one_I_want patches/
> # make makepatchsum

Ok, attached is a patch for www/apache22.

I'm curious to know how you get pkgvi to work with an editor other than vi.  I could find no documentation on this.

the third line above should use .newpatches, not .newpatch.

I read about patches, and they are installed in alphabetical order.
When I ran mkpatches, it created patch-ab even though there were other patches such as patch-ac.  There had been a hole 
at ab, which mkpatches decided to use.   I'm not sure if this is kosher?
Maybe patch-ab needs to be renamed to be the last one?

Attachment: Text patch-ab 2.43 KB
Re: A patch for gettext-asprintf  
On Thu, Oct 04, 2007 at 03:08:00PM -0400, Mitchell Schoenbrun wrote:
> > You haven't read the 11.3.2, have you? :)
> > 
> > # pkgvi work/<path_to_the_file>
> > # mkpatches
> > # cp work/.newpatch/patch-<the_one_I_want patches/
> > # make makepatchsum
> 
> Ok, attached is a patch for www/apache22.
> 
> I'm curious to know how you get pkgvi to work with an editor other than
> vi.  I could find no documentation on this.

Try:
# nroff -man /usr/pkg/man/man1/pkgvi.1 | less -r

I have:
# set | egrep "EDITOR|VISUAL"
EDITOR=/usr/pkg/bin/vim
VISUAL=/usr/pkg/bin/vim

> 
> the third line above should use .newpatches, not .newpatch.
> 
> I read about patches, and they are installed in alphabetical order.
> When I ran mkpatches, it created patch-ab even though there were other
> patches such as patch-ac.  There had been a hole at ab, which mkpatches
> decided to use.   I'm not sure if this is kosher?
> Maybe patch-ab needs to be renamed to be the last one?
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post1817
> 

Content-Description: Sourceforge Attachment
> $NetBSD$
> 
> --- modules/metadata/mod_mime_magic.c.orig	2006-10-03 05:47:35.000000000 -0700
> +++ modules/metadata/mod_mime_magic.c
> @@ -226,7 +226,7 @@ static int parse(server_rec *, apr_pool_
>  static int match(request_rec *, unsigned char *, apr_size_t);
>  static int mget(request_rec *, union VALUETYPE *, unsigned char *,
>                  struct magic *, apr_size_t);
> -static int mcheck(request_rec *, union VALUETYPE *, struct magic *);
> +static int mod_mime_magic_mcheck(request_rec *, union VALUETYPE *, struct magic *);
>  static void mprint(request_rec *, union VALUETYPE *, struct magic *);
>  
>  static int uncompress(request_rec *, int,
> @@ -1580,7 +1580,7 @@ static int match(request_rec *r, unsigne
>  
>          /* check if main entry matches */
>          if (!mget(r, &p, s, m, nbytes) ||
> -            !mcheck(r, &p, m)) {
> +            !mod_mime_magic_mcheck(r, &p, m)) {
>              struct magic *
m_cont;
>  
>              /*
> @@ -1651,7 +1651,7 @@ static int match(request_rec *r, unsigne
>                      cont_level = m->cont_level;
>                  }
>                  if (mget(r, &p, s, m, nbytes) &&
> -                    mcheck(r, &p, m)) {
> +                    mod_mime_magic_mcheck(r, &p, m)) {
>       
               /*
>                       * This continuation matched. Print its message, with a
>                       * blank before it if the previous item printed and this
> @@ -1824,7 +1824,7 @@ static int mget(request_rec *r, union VA
>      return 1;
>  }
>  
> -static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
> +static int mod_mime_magic_mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
>  {
>      register unsigned long l = m->value.l;
>      register unsigned long v;
> @@ -1877,7 +1877,7 @@ static int mcheck(request_rec *r, union 
>      default:
>          /*  bogosity, pretend that it just wasn't a match */
>          ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
> -                    MODNAME ": invalid type %d in mcheck().", m->type);
> +                    MODNAME ": invalid type %d in mod_mime_magic_mcheck().", m->type);
>          return 0;
>      }
>  
> @@ -1962,7 +1962,7 @@ static int mcheck(request_rec *r, union 
>          /* bogosity, pretend it didn't match */
>          matched = 0;
>          ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
> -                    MODNAME ": mcheck: can't happen: invalid relation %d.",
> +                    MODNAME ": mod_mime_magic_mcheck:...
Re: A patch for gettext-asprintf  
On Wed, Oct 03, 2007 at 10:39:49PM -0400, Mitchell Schoenbrun wrote:
> Attached is a patch file for gettext-asprintf, version 0.14.6
> 
> It is a mod to the file autosprintf.cc.
> All I've done is added #include <malloc.h>
> The compile failed because free() was not defined.
> 

I ran into this as well when trying to reproduce your
gettext proper issue (the mcs one).  As mentioned it's a bug
in stdlib.h.  A fixed stdlib.h is in pkgsrc_qnxutil archive
in the download section.  PR 51606.

Regards,

-seanb
Re: A patch for gettext-asprintf  
A couple of comments.

I did read 11.3.2.   It seemed like it would make perfect sense if you already knew what they were talking about.   
There's nothing explaining what pkgvi does, or why one would use it.   I'll use your example as a guide to try and 
figure out what is going on.

As far as Sean's fix, this suggests to me that I have to work carefully through all this as in some cases there is no 
change to be made in pkgsrc at all.

One more spooky thing.   I didn't see the asprintf problem the first time I compiled.   How could that be? Well the only
 thing I can think of is that I was using the older compiler at the time.

And of course thank you both.
Re: A patch for gettext-asprintf  
On Thu, Oct 04, 2007 at 12:28:31AM -0400, Mitchell Schoenbrun wrote:
> A couple of comments.
> 
> I did read 11.3.2.   It seemed like it would make perfect sense if you
> already knew what they were talking about.   There's nothing explaining
> what pkgvi does, or why one would use it.   I'll use your example as a
> guide to try and figure out what is going on.

pkgvi is just a helper script that spawns your EDITOR or vi
and backups the file to .orig if modified which is what
mkpatches wants.

> 
> As far as Sean's fix, this suggests to me that I have to work carefully
> through all this as in some cases there is no change to be made in
> pkgsrc at all.

He he :)  The whole reason for pkgsrc_qnxutil archive is to
fix bug / omissions.  Some of them were a real pain to find
when you have to wade through aclocal, autoconf layers which
I still know next to nothing about.  The proc issue was
another doosie.  But it's good in that actually using the
software makes it better.

> 
> One more spooky thing.   I didn't see the asprintf problem the first
> time I compiled.   How could that be? Well the only thing I can think of
> is that I was using the older compiler at the time.

I was wondering how you got it built the first time as
well...

I'll have to take a look at your apache22 issue.  Since
apr0 and apr are different packages I don't see why they
shouldn't be able to co-exist.

> 
> And of course thank you both.
Re: A patch for gettext-asprintf  
> I'll have to take a look at your apache22 issue.  Since
> apr0 and apr are different packages I don't see why they
> shouldn't be able to co-exist.

I'm going to investigate this too.