Browse Source

Lots and lots of i18n updates.

Author: doogie
Date: 2003-02-10 07:34:41 GMT
Lots and lots of i18n updates.
tags/debian/0.7.21
Arch Librarian 17 years ago
parent
commit
dc738e7ae6
30 changed files with 16890 additions and 7941 deletions
  1. +16
    -16
      ftparchive/apt-ftparchive.cc
  2. +8
    -7
      ftparchive/cachedb.cc
  3. +4
    -3
      ftparchive/contents.cc
  4. +16
    -15
      ftparchive/multicompress.cc
  5. +12
    -11
      ftparchive/override.cc
  6. +26
    -26
      ftparchive/writer.cc
  7. +9
    -8
      methods/cdrom.cc
  8. +16
    -15
      methods/connect.cc
  9. +4
    -3
      methods/copy.cc
  10. +4
    -3
      methods/file.cc
  11. +43
    -41
      methods/ftp.cc
  12. +7
    -6
      methods/gzip.cc
  13. +22
    -21
      methods/http.cc
  14. +14
    -13
      methods/rsh.cc
  15. +602
    -20
      po/apt-all.pot
  16. +1002
    -653
      po/da.po
  17. +985
    -550
      po/de.po
  18. +969
    -164
      po/en_GB.po
  19. +1502
    -910
      po/es.po
  20. +1171
    -813
      po/fr.po
  21. +1438
    -894
      po/hu.po
  22. +1125
    -787
      po/it.po
  23. +1
    -1
      po/makefile
  24. +1500
    -622
      po/nl.po
  25. +1070
    -347
      po/no_NO.po
  26. +1068
    -338
      po/pl.po
  27. +1075
    -344
      po/pt_BR.po
  28. +1124
    -734
      po/ru.po
  29. +1074
    -344
      po/sv.po
  30. +983
    -232
      po/zh_TW.po

+ 16
- 16
ftparchive/apt-ftparchive.cc View File

@@ -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;
}


+ 8
- 7
ftparchive/cachedb.cc View File

@@ -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;


+ 4
- 3
ftparchive/contents.cc View File

@@ -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;
}


+ 16
- 15
ftparchive/multicompress.cc View File

@@ -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();
}


+ 12
- 11
ftparchive/override.cc View File

@@ -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;
}


+ 26
- 26
ftparchive/writer.cc View File

@@ -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)


+ 9
- 8
methods/cdrom.cc View File

@@ -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;


+ 16
- 15
methods/connect.cc View File

@@ -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);
}
/*}}}*/

+ 4
- 3
methods/copy.cc View File

@@ -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);


+ 4
- 3
methods/file.cc View File

@@ -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;


+ 43
- 41
methods/ftp.cc View File

@@ -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");
_error->Errno("read",_("Problem hashing file"));
return false;
}
}
@@ -870,7 +872,7 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume,
{
if (Tag == 550)
Missing = true;
return _error->Error("Unable to fetch file, server said '%s'",Msg.c_str());
return _error->Error(_("Unable to fetch file, server said '%s'"),Msg.c_str());
}
// Finish off the data connection
@@ -885,7 +887,7 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume,
if (WaitFd(DataFd,false,TimeOut) == false)
{
Close();
return _error->Error("Data socket timed out");
return _error->Error(_("Data socket timed out"));
}
// Read the data..
@@ -915,7 +917,7 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume,
if (ReadResp(Tag,Msg) == false)
return false;
if (Tag >= 400)
return _error->Error("Data transfer failed, server said '%s'",Msg.c_str());
return _error->Error(_("Data transfer failed, server said '%s'"),Msg.c_str());
return true;
}
/*}}}*/
@@ -990,7 +992,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
}
// Get the files information
Status("Query");
Status(_("Query"));
unsigned long Size;
if (Server->Size(File,Size) == false ||
Server->ModTime(File,FailTime) == false)
@@ -1097,7 +1099,7 @@ int main(int argc,const char *argv[])
// Run the http method
string Path = flNotFile(argv[0]) + "http";
execl(Path.c_str(),Path.c_str(),0);
cerr << "Unable to invoke " << Path << endl;
cerr << _("Unable to invoke ") << Path << endl;
exit(100);
}
}


+ 7
- 6
methods/gzip.cc View File

@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: gzip.cc,v 1.16 2001/05/27 04:29:30 jgg Exp $
// $Id: gzip.cc,v 1.17 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################

GZip method - Take a file URI in and decompress it into the target
@@ -9,6 +9,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/acquire-method.h>
@@ -53,7 +54,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)

int GzOut[2];
if (pipe(GzOut) < 0)
return _error->Errno("pipe","Couldn't open pipe for %s",Prog);
return _error->Errno("pipe",_("Couldn't open pipe for %s"),Prog);

// Fork gzip
int Process = ExecFork();
@@ -98,7 +99,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
if (Count < 0)
{
_error->Errno("read", "Read error from %s process",Prog);
_error->Errno("read", _("Read error from %s process"),Prog);
Failed = true;
break;
}
@@ -129,16 +130,16 @@ bool GzipMethod::Fetch(FetchItem *Itm)
// Transfer the modification times
struct stat Buf;
if (stat(Path.c_str(),&Buf) != 0)
return _error->Errno("stat","Failed to stat");
return _error->Errno("stat",_("Failed to stat"));

struct utimbuf TimeBuf;
TimeBuf.actime = Buf.st_atime;
TimeBuf.modtime = Buf.st_mtime;
if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
return _error->Errno("utime","Failed to set modification time");
return _error->Errno("utime",_("Failed to set modification time"));

if (stat(Itm->DestFile.c_str(),&Buf) != 0)
return _error->Errno("stat","Failed to stat");
return _error->Errno("stat",_("Failed to stat"));
// Return a Done response
Res.LastModified = Buf.st_mtime;


+ 22
- 21
methods/http.cc View File

@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: http.cc,v 1.54 2002/04/18 05:09:38 jgg Exp $
// $Id: http.cc,v 1.55 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################

HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -25,6 +25,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
@@ -336,7 +337,7 @@ int ServerState::RunHeaders()
{
State = Header;
Owner->Status("Waiting for file");
Owner->Status(_("Waiting for file"));

Major = 0;
Minor = 0;
@@ -482,7 +483,7 @@ bool ServerState::HeaderLine(string Line)

// The http server might be trying to do something evil.
if (Line.length() >= MAXLEN)
return _error->Error("Got a single header line over %u chars",MAXLEN);
return _error->Error(_("Got a single header line over %u chars"),MAXLEN);

string::size_type Pos = Line.find(' ');
if (Pos == string::npos || Pos+1 > Line.length())
@@ -490,7 +491,7 @@ bool ServerState::HeaderLine(string Line)
// Blah, some servers use "connection:closes", evil.
Pos = Line.find(':');
if (Pos == string::npos || Pos + 2 > Line.length())
return _error->Error("Bad header line");
return _error->Error(_("Bad header line"));
Pos++;
}

@@ -509,14 +510,14 @@ bool ServerState::HeaderLine(string Line)
{
if (sscanf(Line.c_str(),"HTTP/%u.%u %u %[^\n]",&Major,&Minor,
&Result,Code) != 4)
return _error->Error("The http server sent an invalid reply header");
return _error->Error(_("The http server sent an invalid reply header"));
}
else
{
Major = 0;
Minor = 9;
if (sscanf(Line.c_str(),"HTTP %u %[^\n]",&Result,Code) != 2)
return _error->Error("The http server sent an invalid reply header");
return _error->Error(_("The http server sent an invalid reply header"));
}

/* Check the HTTP response header to get the default persistance
@@ -545,7 +546,7 @@ bool ServerState::HeaderLine(string Line)
return true;
if (sscanf(Val.c_str(),"%lu",&Size) != 1)
return _error->Error("The http server sent an invalid Content-Length header");
return _error->Error(_("The http server sent an invalid Content-Length header"));
return true;
}

@@ -560,9 +561,9 @@ bool ServerState::HeaderLine(string Line)
HaveContent = true;
if (sscanf(Val.c_str(),"bytes %lu-%*u/%lu",&StartPos,&Size) != 2)
return _error->Error("The http server sent an invalid Content-Range header");
return _error->Error(_("The http server sent an invalid Content-Range header"));
if ((unsigned)StartPos > Size)
return _error->Error("This http server has broken range support");
return _error->Error(_("This http server has broken range support"));
return true;
}
@@ -586,7 +587,7 @@ bool ServerState::HeaderLine(string Line)
if (stringcasecmp(Tag,"Last-Modified:") == 0)
{
if (StrToTime(Val,Date) == false)
return _error->Error("Unknown date format");
return _error->Error(_("Unknown date format"));
return true;
}

@@ -729,12 +730,12 @@ bool HttpMethod::Go(bool ToFile,ServerState *Srv)
{
if (errno == EINTR)
return true;
return _error->Errno("select","Select failed");
return _error->Errno("select",_("Select failed"));
}
if (Res == 0)
{
_error->Error("Connection timed out");
_error->Error(_("Connection timed out"));
return ServerDie(Srv);
}
@@ -757,7 +758,7 @@ bool HttpMethod::Go(bool ToFile,ServerState *Srv)
if (FileFD != -1 && FD_ISSET(FileFD,&wfds))
{
if (Srv->In.Write(FileFD) == false)
return _error->Errno("write","Error writing to output file");
return _error->Errno("write",_("Error writing to output file"));
}

// Handle commands from APT
@@ -785,7 +786,7 @@ bool HttpMethod::Flush(ServerState *Srv)
while (Srv->In.WriteSpace() == true)
{
if (Srv->In.Write(File->Fd()) == false)
return _error->Errno("write","Error writing to file");
return _error->Errno("write",_("Error writing to file"));
if (Srv->In.IsLimit() == true)
return true;
}
@@ -810,7 +811,7 @@ bool HttpMethod::ServerDie(ServerState *Srv)
while (Srv->In.WriteSpace() == true)
{
if (Srv->In.Write(File->Fd()) == false)
return _error->Errno("write","Error writing to the file");
return _error->Errno("write",_("Error writing to the file"));

// Done
if (Srv->In.IsLimit() == true)
@@ -824,9 +825,9 @@ bool HttpMethod::ServerDie(ServerState *Srv)
{
Srv->Close();
if (LErrno == 0)
return _error->Error("Error reading from server Remote end closed connection");
return _error->Error(_("Error reading from server Remote end closed connection"));
errno = LErrno;
return _error->Errno("read","Error reading from server");
return _error->Errno("read",_("Error reading from server"));
}
else
{
@@ -908,7 +909,7 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv)
lseek(File->Fd(),0,SEEK_SET);
if (Srv->In.Hash->AddFD(File->Fd(),Srv->StartPos) == false)
{
_error->Errno("read","Problem hashing file");
_error->Errno("read",_("Problem hashing file"));
return 5;
}
lseek(File->Fd(),0,SEEK_END);
@@ -1057,7 +1058,7 @@ int HttpMethod::Loop()
// The header data is bad
case 2:
{
_error->Error("Bad header Data");
_error->Error(_("Bad header Data"));
Fail(true);
RotateDNS();
continue;
@@ -1074,7 +1075,7 @@ int HttpMethod::Loop()
if (FailCounter >= 2)
{
Fail("Connection failed",true);
Fail(_("Connection failed"),true);
FailCounter = 0;
}
@@ -1165,7 +1166,7 @@ int HttpMethod::Loop()
}
default:
Fail("Internal error");
Fail(_("Internal error"));
break;
}


+ 14
- 13
methods/rsh.cc View File

@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: rsh.cc,v 1.5 2002/11/09 23:33:26 doogie Exp $
// $Id: rsh.cc,v 1.6 2003/02/10 07:34:41 doogie Exp $
/* ######################################################################

RSH method - Transfer files via rsh compatible program
@@ -11,6 +11,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
#include <apti18n.h>
#include "rsh.h"
#include <apt-pkg/error.h>

@@ -87,7 +88,7 @@ bool RSHConn::Connect(string Host, string User)
int Pipes[4] = {-1,-1,-1,-1};
if (pipe(Pipes) != 0 || pipe(Pipes+2) != 0)
{
_error->Errno("pipe","Failed to create IPC pipe to subprocess");
_error->Errno("pipe",_("Failed to create IPC pipe to subprocess"));
for (int I = 0; I != 4; I++)
close(Pipes[I]);
return false;
@@ -179,21 +180,21 @@ bool RSHConn::ReadLine(string &Text)
if (WaitFd(ReadFd,false,TimeOut) == false)
{
Close();
return _error->Error("Connection timeout");
return _error->Error(_("Connection timeout"));
}

// Suck it back
int Res = read(ReadFd,Buffer + Len,sizeof(Buffer) - Len);
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."));
}
/*}}}*/
// RSHConn::WriteMsg - Send a message with optional remote sync. /*{{{*/
@@ -222,13 +223,13 @@ bool RSHConn::WriteMsg(string &Text,bool Sync,const char *Fmt,...)
{
Close();
return _error->Error("Connection timeout");
return _error->Error(_("Connection timeout"));
}
int Res = write(WriteFd,S + Start,Len);
if (Res <= 0)
{
_error->Errno("write","Write Error");
_error->Errno("write",_("Write Error"));
Close();
return false;
}
@@ -260,7 +261,7 @@ bool RSHConn::Size(const char *Path,unsigned long &Size)
char *End;
Size = strtoul(Msg.c_str(),&End,10);
if (End == Msg.c_str())
return _error->Error("File Not Found");
return _error->Error(_("File Not Found"));
return true;
}
/*}}}*/
@@ -299,7 +300,7 @@ bool RSHConn::Get(const char *Path,FileFd &To,unsigned long Resume,

if (Resume != 0) {
if (Hash.AddFD(To.Fd(),Resume) == false) {
_error->Errno("read","Problem hashing file");
_error->Errno("read",_("Problem hashing file"));
return false;
}
}
@@ -318,7 +319,7 @@ bool RSHConn::Get(const char *Path,FileFd &To,unsigned long Resume,
if (WaitFd(ReadFd,false,TimeOut) == false)
{
Close();
return _error->Error("Data socket timed out");
return _error->Error(_("Data socket timed out"));
}

// Read the data..
@@ -326,7 +327,7 @@ bool RSHConn::Get(const char *Path,FileFd &To,unsigned long Resume,
if (Res == 0)
{
Close();
return _error->Error("Connection closed prematurely");
return _error->Error(_("Connection closed prematurely"));
}
if (Res < 0)
@@ -421,7 +422,7 @@ bool RSHMethod::Fetch(FetchItem *Itm)

// We say this mainly because the pause here is for the
// ssh connection that is still going
Status("Connecting to %s", Get.Host.c_str());
Status(_("Connecting to %s"), Get.Host.c_str());

// Get the files information
unsigned long Size;
@@ -429,7 +430,7 @@ bool RSHMethod::Fetch(FetchItem *Itm)
Server->ModTime(File,FailTime) == false)
{
//Fail(true);
//_error->Error("File Not Found"); // Will be handled by Size
//_error->Error(_("File Not Found")); // Will be handled by Size
return false;
}
Res.Size = Size;


+ 602
- 20
po/apt-all.pot View File

@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2003-02-09 18:37-0600\n"
"POT-Creation-Date: 2003-02-09 21:51-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -158,7 +158,7 @@ msgid ""
"cache files, and query information from them\n"
"\n"
"Commands:\n"
" add - Add an package file to the source cache\n"
" add - Add a package file to the source cache\n"
" gencaches - Build both the package and source cache\n"
" showpkg - Show some general information for a single package\n"
" showsrc - Show source records\n"
@@ -232,6 +232,274 @@ msgstr ""
msgid "Cannot get debconf version. Is debconf installed?"
msgstr ""

#: ftparchive/apt-ftparchive.cc:163 ftparchive/apt-ftparchive.cc:336
msgid "Package extension list is too long"
msgstr ""

#: ftparchive/apt-ftparchive.cc:165 ftparchive/apt-ftparchive.cc:179
#: ftparchive/apt-ftparchive.cc:202 ftparchive/apt-ftparchive.cc:251
#: ftparchive/apt-ftparchive.cc:265 ftparchive/apt-ftparchive.cc:287
#, c-format
msgid "Error Processing directory %s"
msgstr ""

#: ftparchive/apt-ftparchive.cc:249
msgid "Source extension list is too long"
msgstr ""

#: ftparchive/apt-ftparchive.cc:366
msgid "Error writing header to contents file"
msgstr ""

#: ftparchive/apt-ftparchive.cc:396
#, c-format
msgid "Error Processing Contents %s"
msgstr ""

#: ftparchive/apt-ftparchive.cc:550
msgid ""
"Usage: apt-ftparchive [options] command\n"
"Commands: packges binarypath [overridefile [pathprefix]]\n"
" sources srcpath [overridefile [pathprefix]]\n"
" contents path\n"
" generate config [groups]\n"
" clean config\n"
"\n"
"apt-ftparchive generates index files for Debian archives. It supports\n"
"many styles of generation from fully automated to functional replacements\n"
"for dpkg-scanpackages and dpkg-scansources\n"
"\n"
"apt-ftparchive generates Package files from a tree of .debs. The\n"
"Package file contains the contents of all the control fields from\n"
"each package as well as the MD5 hash and filesize. An override file\n"
"is supported to force the value of Priority and Section.\n"
"\n"
"Similarly apt-ftparchive generates Sources files from a tree of .dscs.\n"
"The --source-override option can be used to specify a src override file\n"
"\n"
"The 'packages' and 'sources' command should be run in the root of the\n"
"tree. BinaryPath should point to the base of the recursive search and \n"
"override file should contian the override flags. Pathprefix is\n"
"appended to the filename fields if present. Example usage from the \n"
"debian archive:\n"
" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n"
" dists/potato/main/binary-i386/Packages\n"
"\n"
"Options:\n"
" -h This help text\n"
" --md5 Control MD5 generation\n"
" -s=? Source override file\n"
" -q Quiet\n"
" -d=? Select the optional caching database\n"
" --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"
msgstr ""

#: ftparchive/apt-ftparchive.cc:731
msgid "No selections matched"
msgstr ""

#: ftparchive/apt-ftparchive.cc:804
#, c-format
msgid "Some files are missing in the package file group `%s'"
msgstr ""

#: ftparchive/cachedb.cc:43
#, c-format
msgid "DB was corrupted, file renamed to %s.old"
msgstr ""

#: ftparchive/cachedb.cc:59
#, c-format
msgid "Unable to open DB2 file %s"
msgstr ""

#: ftparchive/cachedb.cc:99
#, c-format
msgid "File date has changed %s"
msgstr ""

#: ftparchive/cachedb.cc:140
msgid "Archive has no control record"
msgstr ""

#: ftparchive/cachedb.cc:253 ftparchive/cachedb.cc:257
msgid "Unable to get a cursor"
msgstr ""

#: ftparchive/writer.cc:78
#, c-format
msgid "W: Unable to read directory %s\n"
msgstr ""

#: ftparchive/writer.cc:83
#, c-format
msgid "W: Unable to stat %s\n"
msgstr ""

#: ftparchive/writer.cc:122
msgid "E: "
msgstr ""

#: ftparchive/writer.cc:124
msgid "W: "
msgstr ""

#: ftparchive/writer.cc:131
msgid "E: Errors apply to file "
msgstr ""

#: ftparchive/writer.cc:148 ftparchive/writer.cc:178
#, c-format
msgid "Failed to resolve %s"
msgstr ""

#: ftparchive/writer.cc:160
msgid "Tree walking failed"
msgstr ""

#: ftparchive/writer.cc:185
#, c-format
msgid "Failed to open %s"
msgstr ""

#: ftparchive/writer.cc:242
#, c-format
msgid " DeLink %s [%s]\n"
msgstr ""

#: ftparchive/writer.cc:250
#, c-format
msgid "Failed to readlink %s"
msgstr ""

#: ftparchive/writer.cc:254
#, c-format
msgid "Failed to unlink %s"
msgstr ""

#: ftparchive/writer.cc:261
#, c-format
msgid "*** Failed to link %s to %s"
msgstr ""

#: ftparchive/writer.cc:271
#, c-format
msgid " DeLink limit of %sB hit.\n"
msgstr ""

#: ftparchive/writer.cc:338 apt-inst/extract.cc:181 apt-inst/extract.cc:193
#: apt-inst/extract.cc:210 apt-inst/deb/dpkgdb.cc:121
#, c-format
msgid "Failed to stat %s"
msgstr ""

#: ftparchive/writer.cc:358
msgid "Archive had no package field"
msgstr ""

#: ftparchive/writer.cc:366 ftparchive/writer.cc:576
#, c-format
msgid " %s has no override entry\n"
msgstr ""

#: ftparchive/writer.cc:409 ftparchive/writer.cc:658
#, c-format
msgid " %s maintainer is %s not %s\n"
msgstr ""

#: ftparchive/contents.cc:346 ftparchive/contents.cc:377
msgid "realloc - Failed to allocate memory"
msgstr ""

#: ftparchive/override.cc:38 ftparchive/override.cc:146
#, c-format
msgid "Unable to open %s"
msgstr ""

#: ftparchive/override.cc:64 ftparchive/override.cc:170
#, c-format
msgid "Malformed override %s line %lu #1"
msgstr ""

#: ftparchive/override.cc:78 ftparchive/override.cc:182
#, c-format
msgid "Malformed override %s line %lu #2"
msgstr ""

#: ftparchive/override.cc:92 ftparchive/override.cc:195
#, c-format
msgid "Malformed override %s line %lu #3"
msgstr ""

#: ftparchive/override.cc:131 ftparchive/override.cc:205
#, c-format
msgid "Failed to read the override file %s"
msgstr ""

#: ftparchive/multicompress.cc:75
#, c-format
msgid "Unknown Compresison Algorithm '%s'"
msgstr ""

#: ftparchive/multicompress.cc:105
#, c-format
msgid "Compressed output %s needs a compression set"
msgstr ""

#: ftparchive/multicompress.cc:172 methods/rsh.cc:91
msgid "Failed to create IPC pipe to subprocess"
msgstr ""

#: ftparchive/multicompress.cc:198
msgid "Failed to create FILE*"
msgstr ""

#: ftparchive/multicompress.cc:201