- OpProgress Prog;
- pkgMakeStatusCache(List,Prog,&Map,true);
- Cache = new pkgCache(Map);
- return 0;
-}
- /*}}}*/
-
-int main(int argc, const char **argv)
-{
- MMap *Map = 0;
- const char *debconfver = NULL;
-
- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {'v',"version","version",0},
- {'t',"tempdir","APT::ExtractTemplates::TempDir",CommandLine::HasArg},
- {'c',"config-file",0,CommandLine::ConfigFile},
- {'o',"option",0,CommandLine::ArbItem},
- {0,0,0,0}};
-
- // Initialize the package cache
- if (InitCache(Map, DebFile::Cache) < 0 || Map == 0 || DebFile::Cache == 0)
- {
- fprintf(stderr, _("Cannot initialize APT cache\n"));
- return 100;
- }
-
- // Parse the command line
- CommandLine CmdL(Args,_config);
- if (CmdL.Parse(argc,argv) == false)
- {
- fprintf(stderr, _("Cannot parse commandline options\n"));
- return 100;
- }
-
- // See if the help should be shown
- if (_config->FindB("help") == true || CmdL.FileSize() == 0)
- {
- ShowHelp();
- return 0;
- }
+ pkgCacheGenerator::MakeStatusCache(List,NULL,&Map,true);
+ if (Map == 0)
+ return false;
+ DebFile::Cache = new pkgCache(Map);
+ if (_error->PendingError() == true)
+ return false;