Browse Source

Lots and lots of i18n updates.

Author: doogie
Date: 2003-02-10 07:34:41 GMT
Lots and lots of i18n updates.
debian/1.8.y
Arch Librarian 19 years ago
parent
commit
dc738e7ae6
  1. 32
      ftparchive/apt-ftparchive.cc
  2. 15
      ftparchive/cachedb.cc
  3. 7
      ftparchive/contents.cc
  4. 31
      ftparchive/multicompress.cc
  5. 23
      ftparchive/override.cc
  6. 52
      ftparchive/writer.cc
  7. 17
      methods/cdrom.cc
  8. 31
      methods/connect.cc
  9. 7
      methods/copy.cc
  10. 7
      methods/file.cc
  11. 84
      methods/ftp.cc
  12. 13
      methods/gzip.cc
  13. 43
      methods/http.cc
  14. 27
      methods/rsh.cc
  15. 622
      po/apt-all.pot
  16. 1655
      po/da.po
  17. 1535
      po/de.po
  18. 1133
      po/en_GB.po
  19. 2412
      po/es.po
  20. 1984
      po/fr.po
  21. 2332
      po/hu.po
  22. 1912
      po/it.po
  23. 2
      po/makefile
  24. 2122
      po/nl.po
  25. 1417
      po/no_NO.po
  26. 1406
      po/pl.po
  27. 1419
      po/pt_BR.po
  28. 1858
      po/ru.po
  29. 1418
      po/sv.po
  30. 1215
      po/zh_TW.po

32
ftparchive/apt-ftparchive.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: apt-ftparchive.cc,v 1.5 2002/11/11 04:27:51 doogie Exp $
// $Id: apt-ftparchive.cc,v 1.6 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
apt-scanpackages - Efficient work-alike for dpkg-scanpackages
@ -160,9 +160,9 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
flCombine(OverrideDir,BinOverride),
flCombine(OverrideDir,ExtraOverride));
if (PkgExt.empty() == false && Packages.SetExts(PkgExt) == false)
return _error->Error("Package extension list is too long");
return _error->Error(_("Package extension list is too long"));
if (_error->PendingError() == true)
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
Packages.PathPrefix = PathPrefix;
Packages.DirStrip = ArchiveDir;
@ -176,7 +176,7 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
PkgCompress,Permissions);
Packages.Output = Comp.Input;
if (_error->PendingError() == true)
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
c0out << ' ' << BaseDir << ":" << flush;
@ -199,7 +199,7 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
if (Comp.Finalize(Size) == false)
{
c0out << endl;
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
}
if (Size != 0)
@ -246,9 +246,9 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats)
flCombine(OverrideDir,SrcOverride),
flCombine(OverrideDir,SrcExtraOverride));
if (SrcExt.empty() == false && Sources.SetExts(SrcExt) == false)
return _error->Error("Source extension list is too long");
return _error->Error(_("Source extension list is too long"));
if (_error->PendingError() == true)
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
Sources.PathPrefix = PathPrefix;
Sources.DirStrip = ArchiveDir;
@ -262,7 +262,7 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats)
SrcCompress,Permissions);
Sources.Output = Comp.Input;
if (_error->PendingError() == true)
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
c0out << ' ' << BaseDir << ":" << flush;
@ -284,7 +284,7 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats)
if (Comp.Finalize(Size) == false)
{
c0out << endl;
return _error->Error("Error Processing directory %s",BaseDir.c_str());
return _error->Error(_("Error Processing directory %s"),BaseDir.c_str());
}
if (Size != 0)
@ -333,7 +333,7 @@ bool PackageMap::GenContents(Configuration &Setup,
// Create a package writer object.
ContentsWriter Contents("");
if (PkgExt.empty() == false && Contents.SetExts(PkgExt) == false)
return _error->Error("Package extension list is too long");
return _error->Error(_("Package extension list is too long"));
if (_error->PendingError() == true)
return false;
@ -363,7 +363,7 @@ bool PackageMap::GenContents(Configuration &Setup,
return false;
if (fwrite(Buf,1,ToRead,Comp.Input) != ToRead)
return _error->Errno("fwrite","Error writing header to contents file");
return _error->Errno("fwrite",_("Error writing header to contents file"));
Size -= ToRead;
}
@ -393,7 +393,7 @@ bool PackageMap::GenContents(Configuration &Setup,
if (Comp.Finalize(Size) == false || _error->PendingError() == true)
{
c0out << endl;
return _error->Error("Error Processing Contents %s",
return _error->Error(_("Error Processing Contents %s"),
this->Contents.c_str());
}
@ -547,7 +547,7 @@ bool ShowHelp(CommandLine &CmdL)
return true;
cout <<
"Usage: apt-ftparchive [options] command\n"
_("Usage: apt-ftparchive [options] command\n"
"Commands: packges binarypath [overridefile [pathprefix]]\n"
" sources srcpath [overridefile [pathprefix]]\n"
" contents path\n"
@ -583,7 +583,7 @@ bool ShowHelp(CommandLine &CmdL)
" --no-delink Enable delinking debug mode\n"
" --contents Control contents file generation\n"
" -c=? Read this configuration file\n"
" -o=? Set an arbitary configuration option" << endl;
" -o=? Set an arbitary configuration option") << endl;
return true;
}
@ -728,7 +728,7 @@ bool Generate(CommandLine &CmdL)
if (RegexChoice(List,CmdL.FileList + 2,CmdL.FileList + CmdL.FileSize()) == 0)
{
delete [] List;
return _error->Error("No selections matched");
return _error->Error(_("No selections matched"));
}
_error->DumpErrors();
@ -801,7 +801,7 @@ bool Generate(CommandLine &CmdL)
{
if (MultiCompress::GetStat(flCombine(ArchiveDir,I->PkgFile),I->PkgCompress,B) == false)
{
_error->Warning("Some files are missing in the package file group `%s'",I->PkgFile.c_str());
_error->Warning(_("Some files are missing in the package file group `%s'"),I->PkgFile.c_str());
continue;
}

15
ftparchive/cachedb.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: cachedb.cc,v 1.5 2002/11/22 18:02:08 doogie Exp $
// $Id: cachedb.cc,v 1.6 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
CacheDB
@ -16,6 +16,7 @@
#include "cachedb.h"
#include <apti18n.h>
#include <apt-pkg/error.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/strutl.h>
@ -39,7 +40,7 @@ bool CacheDB::ReadyDB(string DB)
corrupted DB */
if (DBFailed() == true)
{
_error->Warning("DB was corrupted, file renamed to %s.old",DBFile.c_str());
_error->Warning(_("DB was corrupted, file renamed to %s.old"),DBFile.c_str());
rename(DBFile.c_str(),(DBFile+".old").c_str());
}
@ -55,7 +56,7 @@ bool CacheDB::ReadyDB(string DB)
0644,0,0,&Dbp)) != 0)
{
Dbp = 0;
return _error->Errno("db_open","Unable to open DB2 file %s",DB.c_str());
return _error->Errno("db_open",_("Unable to open DB2 file %s"),DB.c_str());
}
DBFile = DB;
@ -95,7 +96,7 @@ bool CacheDB::SetFile(string FileName,struct stat St,FileFd *Fd)
{
CurStat.mtime = htonl(St.st_mtime);
CurStat.Flags = 0;
_error->Warning("File date has changed %s",FileName.c_str());
_error->Warning(_("File date has changed %s"),FileName.c_str());
}
}
else
@ -136,7 +137,7 @@ bool CacheDB::LoadControl()
return false;
if (Control.Control == 0)
return _error->Error("Archive has no control record");
return _error->Error(_("Archive has no control record"));
// Write back the control information
InitQuery("cl");
@ -249,11 +250,11 @@ bool CacheDB::Clean()
#if DB_VERSION_MAJOR >= 2 && DB_VERSION_MINOR >= 7
DBC *Cursor;
if ((errno = Dbp->cursor(Dbp,0,&Cursor,0)) != 0)
return _error->Error("Unable to get a cursor");
return _error->Error(_("Unable to get a cursor"));
#else
DBC *Cursor;
if ((errno = Dbp->cursor(Dbp,0,&Cursor)) != 0)
return _error->Error("Unable to get a cursor");
return _error->Error(_("Unable to get a cursor"));
#endif
DBT Key;

7
ftparchive/contents.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: contents.cc,v 1.3 2001/02/27 04:24:09 jgg Exp $
// $Id: contents.cc,v 1.4 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
contents - Archive contents generator
@ -35,6 +35,7 @@
// Include Files /*{{{*/
#include "contents.h"
#include <apti18n.h>
#include <apt-pkg/extracttar.h>
#include <apt-pkg/error.h>
#include <stdio.h>
@ -342,7 +343,7 @@ bool ContentsExtract::DoItem(Item &Itm,int &Fd)
MaxSize = 512*1024/2;
char *NewData = (char *)realloc(Data,MaxSize*2);
if (NewData == 0)
return _error->Error("realloc - Failed to allocate memory");
return _error->Error(_("realloc - Failed to allocate memory"));
Data = NewData;
MaxSize *= 2;
}
@ -373,7 +374,7 @@ bool ContentsExtract::TakeContents(const void *NewData,unsigned long Length)
char *NewData = (char *)realloc(Data,MaxSize*2);
if (NewData == 0)
return _error->Error("realloc - Failed to allocate memory");
return _error->Error(_("realloc - Failed to allocate memory"));
Data = NewData;
MaxSize *= 2;
}

31
ftparchive/multicompress.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: multicompress.cc,v 1.3 2001/05/29 03:48:27 jgg Exp $
// $Id: multicompress.cc,v 1.4 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
MultiCompressor
@ -20,6 +20,7 @@
#include "multicompress.h"
#include <apti18n.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/md5.h>
@ -71,7 +72,7 @@ MultiCompress::MultiCompress(string Output,string Compress,
// Hmm.. unknown.
if (Comp->Name == 0)
{
_error->Warning("Unknown Compresison Algorithm '%s'",string(Start,I).c_str());
_error->Warning(_("Unknown Compresison Algorithm '%s'"),string(Start,I).c_str());
continue;
}
@ -101,7 +102,7 @@ MultiCompress::MultiCompress(string Output,string Compress,
if (Outputs == 0)
{
_error->Error("Compressed output %s needs a compression set",Output.c_str());
_error->Error(_("Compressed output %s needs a compression set"),Output.c_str());
return;
}
@ -168,7 +169,7 @@ bool MultiCompress::Start()
// Create a data pipe
int Pipe[2] = {-1,-1};
if (pipe(Pipe) != 0)
return _error->Errno("pipe","Failed to create IPC pipe to subprocess");
return _error->Errno("pipe",_("Failed to create IPC pipe to subprocess"));
for (int I = 0; I != 2; I++)
SetCloseExec(Pipe[I],true);
@ -194,10 +195,10 @@ bool MultiCompress::Start()
close(Pipe[0]);
Input = fdopen(Pipe[1],"w");
if (Input == 0)
return _error->Errno("fdopen","Failed to create FILE*");
return _error->Errno("fdopen",_("Failed to create FILE*"));
if (Outputter == -1)
return _error->Errno("fork","Failed to fork");
return _error->Errno("fork",_("Failed to fork"));
return true;
}
/*}}}*/
@ -211,7 +212,7 @@ bool MultiCompress::Die()
fclose(Input);
Input = 0;
bool Res = ExecWait(Outputter,"Compress Child",false);
bool Res = ExecWait(Outputter,_("Compress Child"),false);
Outputter = -1;
return Res;
}
@ -234,7 +235,7 @@ bool MultiCompress::Finalize(unsigned long &OutSize)
{
struct stat St;
if (stat(I->Output.c_str(),&St) != 0)
return _error->Error("Internal Error, Failed to create %s",
return _error->Error(_("Internal Error, Failed to create %s"),
I->Output.c_str());
if (I->OldMTime != St.st_mtime)
@ -285,7 +286,7 @@ bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
// Create a data pipe
int Pipe[2] = {-1,-1};
if (pipe(Pipe) != 0)
return _error->Errno("pipe","Failed to create subprocess IPC");
return _error->Errno("pipe",_("Failed to create subprocess IPC"));
for (int J = 0; J != 2; J++)
SetCloseExec(Pipe[J],true);
@ -320,7 +321,7 @@ bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
Args[1] = Prog->UnCompArgs;
Args[2] = 0;
execvp(Args[0],(char **)Args);
cerr << "Failed to exec compressor " << Args[0] << endl;
cerr << _("Failed to exec compressor ") << Args[0] << endl;
_exit(100);
};
if (Comp == true)
@ -359,7 +360,7 @@ bool MultiCompress::CloseOld(int Fd,int Proc)
{
close(Fd);
if (Proc != -1)
if (ExecWait(Proc,"decompressor",false) == false)
if (ExecWait(Proc,_("decompressor"),false) == false)
return false;
return true;
}
@ -402,7 +403,7 @@ bool MultiCompress::Child(int FD)
{
if (write(I->Fd,Buffer,Res) != Res)
{
_error->Errno("write","IO to subprocess/file failed");
_error->Errno("write",_("IO to subprocess/file failed"));
break;
}
}
@ -454,7 +455,7 @@ bool MultiCompress::Child(int FD)
if (Res == 0)
break;
if (Res < 0)
return _error->Errno("read","Failed to read while computing MD5");
return _error->Errno("read",_("Failed to read while computing MD5"));
NewFileSize += Res;
OldMD5.Add(Buffer,Res);
}
@ -471,7 +472,7 @@ bool MultiCompress::Child(int FD)
{
I->TmpFile.Close();
if (unlink(I->TmpFile.Name().c_str()) != 0)
_error->Errno("unlink","Problem unlinking %s",
_error->Errno("unlink",_("Problem unlinking %s"),
I->TmpFile.Name().c_str());
}
return !_error->PendingError();
@ -486,7 +487,7 @@ bool MultiCompress::Child(int FD)
fchmod(I->TmpFile.Fd(),Permissions);
if (rename(I->TmpFile.Name().c_str(),I->Output.c_str()) != 0)
_error->Errno("rename","Failed to rename %s to %s",
_error->Errno("rename",_("Failed to rename %s to %s"),
I->TmpFile.Name().c_str(),I->Output.c_str());
I->TmpFile.Close();
}

23
ftparchive/override.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: override.cc,v 1.3 2001/06/26 02:50:27 jgg Exp $
// $Id: override.cc,v 1.4 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
Override
@ -16,6 +16,7 @@
#include "override.h"
#include <apti18n.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
@ -34,7 +35,7 @@ bool Override::ReadOverride(string File,bool Source)
FILE *F = fopen(File.c_str(),"r");
if (F == 0)
return _error->Errno("fopen","Unable to open %s",File.c_str());
return _error->Errno("fopen",_("Unable to open %s"),File.c_str());
char Line[500];
unsigned long Counter = 0;
@ -60,7 +61,7 @@ bool Override::ReadOverride(string File,bool Source)
for (; isspace(*End) == 0 && *End != 0; End++);
if (*End == 0)
{
_error->Warning("Malformed override %s line %lu #1",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #1"),File.c_str(),
Counter);
continue;
}
@ -74,7 +75,7 @@ bool Override::ReadOverride(string File,bool Source)
for (; isspace(*End) == 0 && *End != 0; End++);
if (*End == 0)
{
_error->Warning("Malformed override %s line %lu #2",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #2"),File.c_str(),
Counter);
continue;
}
@ -88,7 +89,7 @@ bool Override::ReadOverride(string File,bool Source)
for (; isspace(*End) == 0 && *End != 0; End++);
if (*End == 0)
{
_error->Warning("Malformed override %s line %lu #3",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #3"),File.c_str(),
Counter);
continue;
}
@ -127,7 +128,7 @@ bool Override::ReadOverride(string File,bool Source)
}
if (ferror(F))
_error->Errno("fgets","Failed to read the override file %s",File.c_str());
_error->Errno("fgets",_("Failed to read the override file %s"),File.c_str());
fclose(F);
return true;
}
@ -142,7 +143,7 @@ bool Override::ReadExtraOverride(string File,bool Source)
FILE *F = fopen(File.c_str(),"r");
if (F == 0)
return _error->Errno("fopen","Unable to open %s",File.c_str());
return _error->Errno("fopen",_("Unable to open %s"),File.c_str());
char Line[500];
unsigned long Counter = 0;
@ -166,7 +167,7 @@ bool Override::ReadExtraOverride(string File,bool Source)
for (; isspace(*End) == 0 && *End != 0; End++);
if (*End == 0)
{
_error->Warning("Malformed override %s line %lu #1",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #1"),File.c_str(),
Counter);
continue;
}
@ -178,7 +179,7 @@ bool Override::ReadExtraOverride(string File,bool Source)
for (; isspace(*End) == 0 && *End != 0; End++);
if (*End == 0)
{
_error->Warning("Malformed override %s line %lu #2",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #2"),File.c_str(),
Counter);
continue;
}
@ -191,7 +192,7 @@ bool Override::ReadExtraOverride(string File,bool Source)
for (; isspace(*(End-1)) && End > Value; End--);
if (End == Value)
{
_error->Warning("Malformed override %s line %lu #3",File.c_str(),
_error->Warning(_("Malformed override %s line %lu #3"),File.c_str(),
Counter);
continue;
}
@ -201,7 +202,7 @@ bool Override::ReadExtraOverride(string File,bool Source)
}
if (ferror(F))
_error->Errno("fgets","Failed to read the override file %s",File.c_str());
_error->Errno("fgets",_("Failed to read the override file %s"),File.c_str());
fclose(F);
return true;
}

52
ftparchive/writer.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: writer.cc,v 1.6 2002/11/11 04:27:51 doogie Exp $
// $Id: writer.cc,v 1.7 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
Writer
@ -17,6 +17,7 @@
#include "writer.h"
#include <apti18n.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/configuration.h>
@ -74,12 +75,12 @@ int FTWScanner::Scanner(const char *File,const struct stat *sb,int Flag)
if (Flag == FTW_DNR)
{
Owner->NewLine(1);
c1out << "W: Unable to read directory " << File << endl;
ioprintf(c1out, _("W: Unable to read directory %s\n"), File);
}
if (Flag == FTW_NS)
{
Owner->NewLine(1);
c1out << "W: Unable to stat " << File << endl;
ioprintf(c1out, _("W: Unable to stat %s\n"), File);
}
if (Flag != FTW_F)
return 0;
@ -118,16 +119,16 @@ int FTWScanner::Scanner(const char *File,const struct stat *sb,int Flag)
bool Type = _error->PopMessage(Err);
if (Type == true)
cerr << "E: " << Err << endl;
cerr << _("E: ") << Err << endl;
else
cerr << "W: " << Err << endl;
cerr << _("W: ") << Err << endl;
if (Err.find(File) != string::npos)
SeenPath = true;
}
if (SeenPath == false)
cerr << "E: Errors apply to file '" << File << "'" << endl;
cerr << _("E: Errors apply to file ") << "'" << File << "'" << endl;
return 0;
}
@ -144,7 +145,7 @@ bool FTWScanner::RecursiveScan(string Dir)
if (InternalPrefix.empty() == true)
{
if (realpath(Dir.c_str(),RealPath) == 0)
return _error->Errno("realpath","Failed to resolve %s",Dir.c_str());
return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
InternalPrefix = RealPath;
}
@ -156,7 +157,7 @@ bool FTWScanner::RecursiveScan(string Dir)
if (Res != 0)
{
if (_error->PendingError() == false)
_error->Errno("ftw","Tree walking failed");
_error->Errno("ftw",_("Tree walking failed"));
return false;
}
@ -174,14 +175,14 @@ bool FTWScanner::LoadFileList(string Dir,string File)
if (InternalPrefix.empty() == true)
{
if (realpath(Dir.c_str(),RealPath) == 0)
return _error->Errno("realpath","Failed to resolve %s",Dir.c_str());
return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
InternalPrefix = RealPath;
}
Owner = this;
FILE *List = fopen(File.c_str(),"r");
if (List == 0)
return _error->Errno("fopen","Failed to open %s",File.c_str());
return _error->Errno("fopen",_("Failed to open %s"),File.c_str());
/* We are a tad tricky here.. We prefix the buffer with the directory
name, that way if we need a full path with just use line.. Sneaky and
@ -238,25 +239,26 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
cout << endl;
NewLine(1);
c1out << " DeLink " << (OriginalPath + InternalPrefix.length())
<< " [" << SizeToStr(St.st_size) << "B]" << endl << flush;
ioprintf(c1out, _(" DeLink %s [%s]\n"), (OriginalPath + InternalPrefix.length()),
SizeToStr(St.st_size).c_str());
c1out << flush;
if (NoLinkAct == false)
{
char OldLink[400];
if (readlink(OriginalPath,OldLink,sizeof(OldLink)) == -1)
_error->Errno("readlink","Failed to readlink %s",OriginalPath);
_error->Errno("readlink",_("Failed to readlink %s"),OriginalPath);
else
{
if (unlink(OriginalPath) != 0)
_error->Errno("unlink","Failed to unlink %s",OriginalPath);
_error->Errno("unlink",_("Failed to unlink %s"),OriginalPath);
else
{
if (link(FileName.c_str(),OriginalPath) != 0)
{
// Panic! Restore the symlink
symlink(OldLink,OriginalPath);
return _error->Errno("link","*** Failed to link %s to %s",
return _error->Errno("link",_("*** Failed to link %s to %s"),
FileName.c_str(),
OriginalPath);
}
@ -266,7 +268,7 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
DeLinkBytes += St.st_size;
if (DeLinkBytes/1024 >= DeLinkLimit)
c1out << " DeLink limit of " << SizeToStr(DeLinkBytes) << "B hit." << endl;
ioprintf(c1out, _(" DeLink limit of %sB hit.\n"), SizeToStr(DeLinkBytes).c_str());
}
FileName = OriginalPath;
@ -333,7 +335,7 @@ bool PackagesWriter::DoPackage(string FileName)
// Stat the file for later
struct stat St;
if (fstat(F.Fd(),&St) != 0)
return _error->Errno("fstat","Failed to stat %s",FileName.c_str());
return _error->Errno("fstat",_("Failed to stat %s"),FileName.c_str());
// Pull all the data we need form the DB
string MD5Res;
@ -353,7 +355,7 @@ bool PackagesWriter::DoPackage(string FileName)
Override::Item *OverItem = Over.GetItem(Package);
if (Package.empty() == true)
return _error->Error("Archive had no package field");
return _error->Error(_("Archive had no package field"));
// If we need to do any rewriting of the header do it now..
if (OverItem == 0)
@ -361,7 +363,7 @@ bool PackagesWriter::DoPackage(string FileName)
if (NoOverride == false)
{
NewLine(1);
c1out << " " << Package << " has no override entry" << endl;
ioprintf(c1out, _(" %s has no override entry\n"), Package.c_str());
}
OverItem = &Tmp;
@ -404,9 +406,8 @@ bool PackagesWriter::DoPackage(string FileName)
if (NoOverride == false)
{
NewLine(1);
c1out << " " << Package << " maintainer is " <<
Tags.FindS("Maintainer") << " not " <<
OverItem->OldMaint << endl;
ioprintf(c1out, _(" %s maintainer is %s not %s\n"),
Package.c_str(), Tags.FindS("Maintainer").c_str(), OverItem->OldMaint.c_str());
}
}
@ -572,7 +573,7 @@ bool SourcesWriter::DoPackage(string FileName)
if (NoOverride == false)
{
NewLine(1);
c1out << " " << Tags.FindS("Source") << " has no override entry" << endl;
ioprintf(c1out, _(" %s has no override entry\n"), Tags.FindS("Source").c_str());
}
OverItem = &Tmp;
@ -654,9 +655,8 @@ bool SourcesWriter::DoPackage(string FileName)
if (NoOverride == false)
{
NewLine(1);
c1out << " " << Package << " maintainer is " <<
Tags.FindS("Maintainer") << " not " <<
OverItem->OldMaint << endl;
ioprintf(c1out, _(" %s maintainer is %s not %s\n"), Package.c_str(),
Tags.FindS("Maintainer").c_str(), OverItem->OldMaint.c_str());
}
}
if (NewMaint.empty() == false)

17
methods/cdrom.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: cdrom.cc,v 1.19 2002/11/22 07:26:10 doogie Exp $
// $Id: cdrom.cc,v 1.20 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
CDROM URI method for APT
@ -8,6 +8,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/cdromutl.h>
#include <apt-pkg/error.h>
@ -109,7 +110,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
if (FileExists(DFile) == true)
{
if (ReadConfigFile(Database,DFile) == false)
return _error->Error("Unable to read the cdrom database %s",
return _error->Error(_("Unable to read the cdrom database %s"),
DFile.c_str());
}
DatabaseLoaded = true;
@ -118,15 +119,15 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
// All non IMS queries for package files fail.
if (Itm->IndexFile == true || GetID(Get.Host).empty() == true)
{
Fail("Please use apt-cdrom to make this CD recognized by APT."
" apt-get update cannot be used to add new CDs");
Fail(_("Please use apt-cdrom to make this CD recognized by APT."
" apt-get update cannot be used to add new CDs"));
return true;
}
// We already have a CD inserted, but it is the wrong one
if (CurrentID.empty() == false && Database.Find("CD::" + CurrentID) != Get.Host)
{
Fail("Wrong CD",true);
Fail(_("Wrong CD"),true);
return true;
}
@ -159,12 +160,12 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
// I suppose this should prompt somehow?
if (UnmountCdrom(CDROM) == false)
return _error->Error("Unable to unmount the CD-ROM in %s, it may still be in use.",
return _error->Error(_("Unable to unmount the CD-ROM in %s, it may still be in use."),
CDROM.c_str());
if (MediaFail(Get.Host,CDROM) == false)
{
CurrentID = "FAIL";
Fail("Wrong CD",true);
Fail(_("Wrong CD"),true);
return true;
}
}
@ -173,7 +174,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
Res.Filename = CDROM + File;
struct stat Buf;
if (stat(Res.Filename.c_str(),&Buf) != 0)
return _error->Error("File not found");
return _error->Error(_("File not found"));
if (NewID.empty() == false)
CurrentID = NewID;

31
methods/connect.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: connect.cc,v 1.9 2002/09/14 05:28:38 jgg Exp $
// $Id: connect.cc,v 1.10 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
Connect - Replacement connect call
@ -11,6 +11,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include "connect.h"
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
@ -60,14 +61,14 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
getnameinfo(Addr->ai_addr,Addr->ai_addrlen,
Name,sizeof(Name),Service,sizeof(Service),
NI_NUMERICHOST|NI_NUMERICSERV);
Owner->Status("Connecting to %s (%s)",Host.c_str(),Name);
Owner->Status(_("Connecting to %s (%s)"),Host.c_str(),Name);
/* If this is an IP rotation store the IP we are using.. If something goes
wrong this will get tacked onto the end of the error message */
if (LastHostAddr->ai_next != 0)
{
char Name2[NI_MAXHOST + NI_MAXSERV + 10];
snprintf(Name2,sizeof(Name2),"[IP: %s %s]",Name,Service);
snprintf(Name2,sizeof(Name2),_("[IP: %s %s]"),Name,Service);
Owner->SetFailExtraMsg(string(Name2));
}
else
@ -76,31 +77,31 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
// Get a socket
if ((Fd = socket(Addr->ai_family,Addr->ai_socktype,
Addr->ai_protocol)) < 0)
return _error->Errno("socket","Could not create a socket for %s (f=%u t=%u p=%u)",
return _error->Errno("socket",_("Could not create a socket for %s (f=%u t=%u p=%u)"),
Name,Addr->ai_family,Addr->ai_socktype,Addr->ai_protocol);
SetNonBlock(Fd,true);
if (connect(Fd,Addr->ai_addr,Addr->ai_addrlen) < 0 &&
errno != EINPROGRESS)
return _error->Errno("connect","Cannot initiate the connection "
"to %s:%s (%s).",Host.c_str(),Service,Name);
return _error->Errno("connect",_("Cannot initiate the connection "
"to %s:%s (%s)."),Host.c_str(),Service,Name);
/* This implements a timeout for connect by opening the connection
nonblocking */
if (WaitFd(Fd,true,TimeOut) == false)
return _error->Error("Could not connect to %s:%s (%s), "
"connection timed out",Host.c_str(),Service,Name);
return _error->Error(_("Could not connect to %s:%s (%s), "
"connection timed out"),Host.c_str(),Service,Name);
// Check the socket for an error condition
unsigned int Err;
unsigned int Len = sizeof(Err);
if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)
return _error->Errno("getsockopt","Failed");
return _error->Errno("getsockopt",_("Failed"));
if (Err != 0)
{
errno = Err;
return _error->Errno("connect","Could not connect to %s:%s (%s).",Host.c_str(),
return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
Service,Name);
}
@ -128,7 +129,7 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
sensible */
if (LastHost != Host || LastPort != Port)
{
Owner->Status("Connecting to %s",Host.c_str());
Owner->Status(_("Connecting to %s"),Host.c_str());
// Free the old address structure
if (LastHostAddr != 0)
@ -159,13 +160,13 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
DefPort = 0;
continue;
}
return _error->Error("Could not resolve '%s'",Host.c_str());
return _error->Error(_("Could not resolve '%s'"),Host.c_str());
}
if (Res == EAI_AGAIN)
return _error->Error("Temporary failure resolving '%s'",
return _error->Error(_("Temporary failure resolving '%s'"),
Host.c_str());
return _error->Error("Something wicked happened resolving '%s:%s' (%i)",
return _error->Error(_("Something wicked happened resolving '%s:%s' (%i)"),
Host.c_str(),ServStr,Res);
}
break;
@ -212,6 +213,6 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
if (_error->PendingError() == true)
return false;
return _error->Error("Unable to connect to %s %s:",Host.c_str(),ServStr);
return _error->Error(_("Unable to connect to %s %s:"),Host.c_str(),ServStr);
}
/*}}}*/

7
methods/copy.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: copy.cc,v 1.6 1999/01/20 04:36:43 jgg Exp $
// $Id: copy.cc,v 1.7 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
Copy URI - This method takes a uri like a file: uri and copies it
@ -9,6 +9,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
@ -38,7 +39,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
// Stat the file and send a start message
struct stat Buf;
if (stat(File.c_str(),&Buf) != 0)
return _error->Errno("stat","Failed to stat");
return _error->Errno("stat",_("Failed to stat"));
// Forumulate a result and send a start message
FetchResult Res;
@ -75,7 +76,7 @@ bool CopyMethod::Fetch(FetchItem *Itm)
if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
{
To.OpFail();
return _error->Errno("utime","Failed to set modification time");
return _error->Errno("utime",_("Failed to set modification time"));
}
URIDone(Res);

7
methods/file.cc

@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: file.cc,v 1.8 2000/01/27 04:15:10 jgg Exp $
// $Id: file.cc,v 1.9 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
File URI method for APT
@ -13,6 +13,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
@ -38,7 +39,7 @@ bool FileMethod::Fetch(FetchItem *Itm)
string File = Get.Path;
FetchResult Res;
if (Get.Host.empty() == false)
return _error->Error("Invalid URI, local URIS must not start with //");
return _error->Error(_("Invalid URI, local URIS must not start with //"));
// See if the file exists
struct stat Buf;
@ -73,7 +74,7 @@ bool FileMethod::Fetch(FetchItem *Itm)
}
if (Res.Filename.empty() == true)
return _error->Error("File not found");
return _error->Error(_("File not found"));
URIDone(Res);
return true;

84
methods/ftp.cc

<
@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: ftp.cc,v 1.29 2002/04/24 05:35:13 jgg Exp $
// $Id: ftp.cc,v 1.30 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################
FTP Aquire Method - This is the FTP aquire method for APT.
@ -15,6 +15,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
@ -158,18 +159,18 @@ bool FTPConn::Open(pkgAcqMethod *Owner)
return false;
// Login must be before getpeername otherwise dante won't work.
Owner->Status("Logging in");
Owner->Status(_("Logging in"));
bool Res = Login();
// Get the remote server's address
PeerAddrLen = sizeof(PeerAddr);
if (getpeername(ServerFd,(sockaddr *)&PeerAddr,&PeerAddrLen) != 0)
return _error->Errno("getpeername","Unable to determine the peer name");
return _error->Errno("getpeername",_("Unable to determine the peer name"));
// Get the local machine's address
ServerAddrLen = sizeof(ServerAddr);
if (getsockname(ServerFd,(sockaddr *)&ServerAddr,&ServerAddrLen) != 0)
return _error->Errno("getsockname","Unable to determine the local name");
return _error->Errno("getsockname",_("Unable to determine the local name"));
return Res;
}
@ -200,19 +201,19 @@ bool FTPConn::Login()
if (ReadResp(Tag,Msg) == false)
return false;
if (Tag >= 400)
return _error->Error("Server refused our connection and said: %s",Msg.c_str());
return _error->Error(_("Server refused our connection and said: %s"),Msg.c_str());
// Send the user
if (WriteMsg(Tag,Msg,"USER %s",User.c_str()) == false)
return false;
if (Tag >= 400)
return _error->Error("USER failed, server said: %s",Msg.c_str());
return _error->Error(_("USER failed, server said: %s"),Msg.c_str());
// Send the Password
if (WriteMsg(Tag,Msg,"PASS %s",Pass.c_str()) == false)
return false;
if (Tag >= 400)
return _error->Error("PASS failed, server said: %s",Msg.c_str());
return _error->Error(_("PASS failed, server said: %s"),Msg.c_str());
// Enter passive mode
if (_config->Exists("Acquire::FTP::Passive::" + ServerName.Host) == true)
@ -226,13 +227,13 @@ bool FTPConn::Login()
if (ReadResp(Tag,Msg) == false)
return false;
if (Tag >= 400)
return _error->Error("Server refused our connection and said: %s",Msg.c_str());
return _error->Error(_("Server refused our connection and said: %s"),Msg.c_str());
// Perform proxy script execution
Configuration::Item const *Opts = _config->Tree("Acquire::ftp::ProxyLogin");
if (Opts == 0 || Opts->Child == 0)
return _error->Error("A proxy server was specified but no login "
"script, Acquire::ftp::ProxyLogin is empty.");
return _error->Error(_("A proxy server was specified but no login "
"script, Acquire::ftp::ProxyLogin is empty."));
Opts = Opts->Child;
// Iterate over the entire login script
@ -259,7 +260,7 @@ bool FTPConn::Login()
if (WriteMsg(Tag,Msg,"%s",Tmp.c_str()) == false)
return false;
if (Tag >= 400)
return _error->Error("Login script command '%s' failed, server said: %s",Tmp.c_str(),Msg.c_str());
return _error->Error(_("Login script command '%s' failed, server said: %s"),Tmp.c_str(),Msg.c_str());
}
// Enter passive mode
@ -285,7 +286,7 @@ bool FTPConn::Login()
if (WriteMsg(Tag,Msg,"TYPE I") == false)
return false;
if (Tag >= 400)
return _error->Error("TYPE failed, server said: %s",Msg.c_str());
return _error->Error(_("TYPE failed, server said: %s"),Msg.c_str());
return true;
}
@ -323,23 +324,23 @@ bool FTPConn::ReadLine(string &Text)
if (WaitFd(ServerFd,false,TimeOut) == false)
{
Close();
return _error->Error("Connection timeout");
return _error->Error(_("Connection timeout"));
}
// Suck it back
int Res = read(ServerFd,Buffer + Len,sizeof(Buffer) - Len);
if (Res == 0)
_error->Error("Server closed the connection");
_error->Error(_("Server closed the connection"));
if (Res <= 0)
{
_error->Errno("read","Read error");
_error->Errno("read",_("Read error"));
Close();
return false;
}
Len += Res;
}
return _error->Error("A response overflowed the buffer.");
return _error->Error(_("A response overflowed the buffer."));
}
/*}}}*/
// FTPConn::ReadResp - Read a full response from the server /*{{{*/
@ -356,7 +357,7 @@ bool FTPConn::ReadResp(unsigned int &Ret,string &Text)
char *End;
Ret = strtol(Msg.c_str(),&End,10);
if (End - Msg.c_str() != 3)
return _error->Error("Protocol corruption");
return _error->Error(_("Protocol corruption"));
// All done ?
Text = Msg.c_str()+4;
@ -368,7 +369,7 @@ bool FTPConn::ReadResp(unsigned int &Ret,string &Text)
}
if (*End != '-')
return _error->Error("Protocol corruption");
return _error->Error(_("Protocol corruption"));
/* Okay, here we do the continued message trick. This is foolish, but
proftpd follows the protocol as specified and wu-ftpd doesn't, so
@ -434,13 +435,13 @@ bool FTPConn::WriteMsg(unsigned int &Ret,string &Text,const char *Fmt,...)
if (WaitFd(ServerFd,true,TimeOut) == false)
{
Close();
return _error->Error("Connection timeout");
return _error->Error(_("Connection timeout"));
}
int Res = write(ServerFd,S + Start,Len);
if (Res <= 0)
{
_error->Errno("write","Write Error");
_error->Errno("write",_("Write Error"));
Close();
return false;
}
@ -681,24 +682,24 @@ bool FTPConn::CreateDataFd()
// Get a socket
if ((DataFd = socket(PasvAddr->ai_family,PasvAddr->ai_socktype,
PasvAddr->ai_protocol)) < 0)
return _error->Errno("socket","Could not create a socket");
return _error->Errno("socket",_("Could not create a socket"));
// Connect to the server
SetNonBlock(DataFd,true);
if (connect(DataFd,PasvAddr->ai_addr,PasvAddr->ai_addrlen) < 0 &&
errno != EINPROGRESS)
return _error->Errno("socket","Could not create a socket");
return _error->Errno("socket",_("Could not create a socket"));
/* This implements a timeout for connect by opening the connection
nonblocking */
if (WaitFd(DataFd,true,TimeOut) == false)
return _error->Error("Could not connect data socket, connection timed out");
return _error->Error(_("Could not connect data socket, connection timed out"));
unsigned int Err;
unsigned int Len = sizeof(Err);
if (getsockopt(DataFd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)
return _error->Errno("getsockopt","Failed");
return _error->Errno("getsockopt",_("Failed"));
if (Err != 0)
return _error->Error("Could not connect passive socket.");
return _error->Error(_("Could not connect passive socket."));
return true;
}
@ -716,32 +717,33 @@ bool FTPConn::CreateDataFd()
Hints.ai_family = ((struct sockaddr *)&ServerAddr)->sa_family;
int Res;
if ((Res = getaddrinfo(0,"0",&Hints,&BindAddr)) != 0)
return _error->Error("getaddrinfo was unable to get a listening socket");
return _error->Error(_("getaddrinfo was unable to get a listening socket"));
// Construct the socket
if ((DataListenFd = socket(BindAddr->ai_family,BindAddr->ai_socktype,
BindAddr->ai_protocol)) < 0)
{
freeaddrinfo(BindAddr);
return _error->Errno("socket","Could not create a socket");
return _error->Errno("socket",_("Could not create a socket"));
}
// Bind and listen
if (bind(DataListenFd,BindAddr->ai_addr,BindAddr->ai_addrlen) < 0)
{
freeaddrinfo(BindAddr);
return _error->Errno("bind","Could not bind a socket");
return _error->Errno("bind",_("Could not bind a socket"));
}
freeaddrinfo(BindAddr);
if (listen(DataListenFd,1) < 0)
return _error->Errno("listen","Could not listen on the socket");
return _error->Errno("listen",_("Could not listen on the socket"));
SetNonBlock(DataListenFd,true);
// Determine the name to send to the remote
struct sockaddr_storage Addr;
socklen_t AddrLen = sizeof(Addr);
if (getsockname(DataListenFd,(sockaddr *)&Addr,&AddrLen) < 0)
return _error->Errno("getsockname","Could not determine the socket's name");
return _error->Errno("getsockname",_("Could not determine the socket's name"));
// Reverse the address. We need the server address and the data port.
char Name[NI_MAXHOST];
@ -772,7 +774,7 @@ bool FTPConn::CreateDataFd()
(int)(Port >> 8) & 0xff, (int)(Port & 0xff)) == false)
return false;
if (Tag >= 400)
return _error->Error("Unable to send PORT command");
return _error->Error(_("Unable to send PORT command"));
return true;
}
@ -782,7 +784,7 @@ bool FTPConn::CreateDataFd()
if (AFMap[J].Family == ((struct sockaddr *)&Addr)->sa_family)
Proto = AFMap[J].IETFFamily;
if (Proto == 0)
return _error->Error("Unkonwn address family %u (AF_*)",
return _error->Error(_("Unknown address family %u (AF_*)"),
((struct sockaddr *)&Addr)->sa_family);
// Send the EPRT command
@ -791,7 +793,7 @@ bool FTPConn::CreateDataFd()
if (WriteMsg(Tag,Msg,"EPRT |%u|%s|%s|",Proto,Name,Service) == false)
return false;
if (Tag >= 400)
return _error->Error("EPRT failed, server said: %s",Msg.c_str());
return _error->Error(_("EPRT failed, server said: %s"),Msg.c_str());
return true;
}
/*}}}*/
@ -811,14 +813,14 @@ bool FTPConn::Finalize()
// Wait for someone to connect..
if (WaitFd(DataListenFd,false,TimeOut) == false)
return _error->Error("Data socket connect timed out");
return _error->Error(_("Data socket connect timed out"));
// Accept the connection
struct sockaddr_in Addr;
socklen_t Len = sizeof(Addr);
DataFd = accept(DataListenFd,(struct sockaddr *)&Addr,&Len);
if (DataFd < 0)
return _error->Errno("accept","Unable to accept connection");
return _error->Errno("accept",_("Unable to accept connection"));
close(DataListenFd);
DataListenFd = -1;
@ -857,7 +859,7 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume,
{
if (Hash.AddFD(To.Fd(),Resume) == false)
{
_error->Errno("read","Problem hashing file");