RPM Community Forums

Mailing List Message of <rpm-lsb>

Re: LSB Package API

From: Denis Washington <dwashington@gmx.net>
Date: Sat 21 Jun 2008 - 16:35:39 CEST
Message-Id: <1214058939.5778.88.camel@dwashington>
Ah, didn't know that. Thanks!

Regards,
Denis

On Sat, 2008-06-21 at 10:24 -0400, Jeff Johnson wrote:
> On Jun 21, 2008, at 9:55 AM, Jeff Johnson wrote:
> 
> >
> > On Jun 21, 2008, at 5:15 AM, Denis Washington wrote:
> >>
> > As promised, here's certain issues I see in the current  
> > implementation.
> >
> 
> 
> The data type for Summary:/Description: is RPM_I18NSTRING_TYPE,
> not RPM_STRING_TYPE. Basically that means that yo should not
> use headerAddEntry(), but rather
> 
> /** \ingroup header
>   * Add locale specific tag to header.
>   * A NULL lang is interpreted as the C locale. Here are the rules:
>   * \verbatim
>   *      - If the tag isn't in the header, it's added with the passed  
> string
>   *         as new value.
>   *      - If the tag occurs multiple times in entry, which tag is  
> affected
>   *         by the operation is undefined.
>   *      - If the tag is in the header w/ this language, the entry is
>   *         *replaced* (like headerModifyEntry()).
>   * \endverbatim
>   * This function is intended to just "do the right thing". If you need
>   * more fine grained control use headerAddEntry() and  
> headerModifyEntry().
>   *
>   * @param h             header
>   * @param tag           tag
>   * @param string        tag value
>   * @param lang          locale
>   * @return              1 on success, 0 on failure
>   */
> /*@unused@*/ static inline
> int headerAddI18NString(Header h, int_32 tag, const char * string,
>                  const char * lang)
>          /*@modifies h @*/
> 
> In this snippet:
> 
>      if (mf->pkgdisplayedname)
>          headerAddEntry(header, RPMTAG_SUMMARY, RPM_STRING_TYPE, mf- 
>  >pkgdisplayedname, 1);
>      if (mf->pkgdescription)
>          headerAddEntry(header, RPMTAG_DESCRIPTION, RPM_STRING_TYPE,  
> mf->pkgdescription, 1);
> 
> Nite that RPMTAG_GROUP is also RPM_I18NSTRING_TYPE if/when you get  
> around
> to including.
> 
> And also note that there are much deeper issues with I18N in *.rpm  
> packages.
> 
> hth
> 
> 73 de Jeff
> ______________________________________________________________________
> RPM Package Manager                                    
> LSB Communication List                                rpm-lsb@rpm5.org
Received on Sat Jun 21 16:35:53 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.