X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b2e465d6d32d2dc884f58b94acb7e35f671a87fe..62f6ecbf2f204d95e98fc5480c5a0db43b52d2be:/cmdline/apt-sortpkgs.cc diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index bacaf01dd..46989044e 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-sortpkgs.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $ +// $Id: apt-sortpkgs.cc,v 1.5 2003/01/11 07:18:44 jgg Exp $ /* ###################################################################### APT Sort Packages - Program to sort Package and Source files @@ -12,23 +12,29 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include #include +#include +#include -#include -#include - #include #include +#include #include + +#include /*}}}*/ -struct PkgName +using namespace std; + +struct PkgName /*{{{*/ { string Name; string Ver; @@ -52,7 +58,7 @@ struct PkgName bool operator >(const PkgName &x) const {return Compare3(x) > 0;}; bool operator ==(const PkgName &x) const {return Compare3(x) == 0;}; }; - + /*}}}*/ // DoIt - Sort a single file /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -103,7 +109,7 @@ bool DoIt(string InFile) // Emit unsigned char *Buffer = new unsigned char[Largest+1]; - for (vector::iterator I = List.begin(); I != List.end(); I++) + for (vector::iterator I = List.begin(); I != List.end(); ++I) { // Read in the Record. if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false) @@ -138,8 +144,8 @@ bool DoIt(string InFile) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; @@ -153,13 +159,12 @@ int ShowHelp() " -h This help text\n" " -s Use source file sorting\n" " -c=? Read this configuration file\n" - " -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp\n"); + " -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n"); return 0; } /*}}}*/ - -int main(unsigned int argc,const char *argv[]) +int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@ -168,7 +173,11 @@ int main(unsigned int argc,const char *argv[]) {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; - + + // Set up gettext support + setlocale(LC_ALL,""); + textdomain(PACKAGE); + // Parse the command line and initialize the package library CommandLine CmdL(Args,_config); if (pkgInitConfig(*_config) == false || @@ -199,3 +208,4 @@ int main(unsigned int argc,const char *argv[]) return 0; } + /*}}}*/