// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-ftparchive.cc,v 1.7 2003/07/18 14:12:07 mdz Exp $
+// $Id: apt-ftparchive.cc,v 1.12 2004/01/02 21:48:13 mdz Exp $
/* ######################################################################
apt-scanpackages - Efficient work-alike for dpkg-scanpackages
return !_error->PendingError();
}
+
/*}}}*/
// PackageMap::GenSources - Actually generate a Source file /*{{{*/
// ---------------------------------------------------------------------
"Commands: packages binarypath [overridefile [pathprefix]]\n"
" sources srcpath [overridefile [pathprefix]]\n"
" contents path\n"
+ " release path\n"
" generate config [groups]\n"
" clean config\n"
"\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"
+ "override file should contain the override flags. Pathprefix is\n"
"appended to the filename fields if present. Example usage from the \n"
- "debian archive:\n"
+ "Debian archive:\n"
" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n"
" dists/potato/main/binary-i386/Packages\n"
"\n"
return true;
}
+ /*}}}*/
+// SimpleGenRelease - Generate a Release file for a directory tree /*{{{*/
+// ---------------------------------------------------------------------
+bool SimpleGenRelease(CommandLine &CmdL)
+{
+ if (CmdL.FileSize() < 2)
+ return ShowHelp(CmdL);
+
+ string Dir = CmdL.FileList[1];
+
+ ReleaseWriter Release("");
+ Release.DirStrip = Dir;
+
+ if (_error->PendingError() == true)
+ return false;
+
+ if (Release.RecursiveScan(Dir) == false)
+ return false;
+
+ Release.Finish();
+
+ return true;
+}
+
/*}}}*/
// Generate - Full generate, using a config file /*{{{*/
// ---------------------------------------------------------------------
CommandLine::Dispatch Cmds[] = {{"packages",&SimpleGenPackages},
{"contents",&SimpleGenContents},
{"sources",&SimpleGenSources},
+ {"release",&SimpleGenRelease},
{"generate",&Generate},
{"clean",&Clean},
{"help",&ShowHelp},