Explorar o código

* apt-pkg/indexrecords.cc:
- fix some i18n issues
* apt-pkg/contrib/strutl.h:
- add new strprintf() function to make i18n strings easier
* apt-pkg/dev/debsystem.cc:
- add missing apti18n.h header

Michael Vogt %!s(int64=17) %!d(string=hai) anos
pai
achega
616c8327a7

+ 2 - 0
.bzr-builddeb/default.conf

@@ -0,0 +1,2 @@
+[BUILDDEB]
+native = True

+ 15 - 0
apt-pkg/contrib/strutl.cc

@@ -1032,6 +1032,21 @@ void ioprintf(ostream &out,const char *format,...)
    out << S;
    out << S;
 }
 }
 									/*}}}*/
 									/*}}}*/
+// strprintf - C format string outputter to C++ strings 		/*{{{*/
+// ---------------------------------------------------------------------
+/* This is used to make the internationalization strings easier to translate
+   and to allow reordering of parameters */
+void strprintf(string &out,const char *format,...) 
+{
+   va_list args;
+   va_start(args,format);
+   
+   // sprintf the description
+   char S[1024];
+   vsnprintf(S,sizeof(S),format,args);
+   out = string(S);
+}
+									/*}}}*/
 // safe_snprintf - Safer snprintf					/*{{{*/
 // safe_snprintf - Safer snprintf					/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* This is a snprintf that will never (ever) go past 'End' and returns a
 /* This is a snprintf that will never (ever) go past 'End' and returns a

+ 1 - 0
apt-pkg/contrib/strutl.h

@@ -59,6 +59,7 @@ bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length);
 bool TokSplitString(char Tok,char *Input,char **List,
 bool TokSplitString(char Tok,char *Input,char **List,
 		    unsigned long ListMax);
 		    unsigned long ListMax);
 void ioprintf(ostream &out,const char *format,...) APT_FORMAT2;
 void ioprintf(ostream &out,const char *format,...) APT_FORMAT2;
+void strprintf(string &out,const char *format,...) APT_FORMAT2;
 char *safe_snprintf(char *Buffer,char *End,const char *Format,...) APT_FORMAT3;
 char *safe_snprintf(char *Buffer,char *End,const char *Format,...) APT_FORMAT3;
 bool CheckDomainList(const string &Host, const string &List);
 bool CheckDomainList(const string &Host, const string &List);
 
 

+ 3 - 3
apt-pkg/indexrecords.cc

@@ -37,14 +37,14 @@ bool indexRecords::Load(const string Filename)
    pkgTagFile TagFile(&Fd, Fd.Size() + 256); // XXX
    pkgTagFile TagFile(&Fd, Fd.Size() + 256); // XXX
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
    {
    {
-      ErrorText = _(("Unable to parse Release file " + Filename).c_str());
+      strprintf(ErrorText, _("Unable to parse Release file %s"),Filename.c_str());
       return false;
       return false;
    }
    }
 
 
    pkgTagSection Section;
    pkgTagSection Section;
    if (TagFile.Step(Section) == false)
    if (TagFile.Step(Section) == false)
    {
    {
-      ErrorText = _(("No sections in Release file " + Filename).c_str());
+      strprintf(ErrorText, _("No sections in Release file %s"), Filename.c_str());
       return false;
       return false;
    }
    }
 
 
@@ -78,7 +78,7 @@ bool indexRecords::Load(const string Filename)
 
 
    if(HashString::SupportedHashes()[i] == NULL)
    if(HashString::SupportedHashes()[i] == NULL)
    {
    {
-      ErrorText = _(("No Hash entry in Release file " + Filename).c_str());
+      strprintf(ErrorText, _("No Hash entry in Release file %s"), Filename.c_str());
       return false;
       return false;
    }  
    }  
 
 

+ 1 - 1
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 
 dnl -- SET THIS TO THE RELEASE VERSION --
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.7.19ubuntu1")
+AC_DEFINE_UNQUOTED(VERSION,"0.7.19ubuntu2")
 PACKAGE="apt"
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE)

+ 7 - 1
debian/changelog

@@ -6,13 +6,19 @@ apt (0.7.19ubuntu2) jaunty; urgency=low
   * cmdline/apt-get.cc:
   * cmdline/apt-get.cc:
     - fix "apt-get source pkg=ver" if binary name != source name
     - fix "apt-get source pkg=ver" if binary name != source name
       (LP: #202219)
       (LP: #202219)
+  * apt-pkg/indexrecords.cc:
+    - fix some i18n issues
+  * apt-pkg/contrib/strutl.h:
+    - add new strprintf() function to make i18n strings easier
+  * apt-pkg/dev/debsystem.cc:
+    - add missing apti18n.h header
 
 
   [ Ian Weisser ]
   [ Ian Weisser ]
   * /apt-pkg/deb/debsystem.cc:
   * /apt-pkg/deb/debsystem.cc:
     - add 'sudo' to the error message to "run 'dpkg --configure -a'"
     - add 'sudo' to the error message to "run 'dpkg --configure -a'"
       (LP: #52697)
       (LP: #52697)
 
 
- --
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 16 Dec 2008 06:59:17 +0100
 
 
 apt (0.7.19ubuntu1) jaunty; urgency=low
 apt (0.7.19ubuntu1) jaunty; urgency=low
 
 

+ 1 - 1
debian/copyright

@@ -1,6 +1,6 @@
 Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
 Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
 
 
-Apt is licened under the terms of the GNU General Public License (GPL),
+Apt is licensed under the terms of the GNU General Public License (GPL),
 version 2.0 or later, as published by the Free Software Foundation.  See
 version 2.0 or later, as published by the Free Software Foundation.  See
 the file COPYING.GPL [included], /usr/share/common-licenses/GPL, or
 the file COPYING.GPL [included], /usr/share/common-licenses/GPL, or
 <http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
 <http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version