+ f.Write(data, strlen(data));
+ f.Close();
+ return fn;
+}
+ /*}}}*/
+// WriteConfig - write out the config data from a debian package file /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void WriteConfig(const DebFile &file)
+{
+ string templatefile = WriteFile(file.Package.c_str(), "template", file.Template);
+ string configscript = WriteFile(file.Package.c_str(), "config", file.Config);
+
+ if (templatefile.empty() == true || configscript.empty() == true)
+ return;
+ cout << file.Package << " " << file.Version << " "
+ << templatefile << " " << configscript << endl;
+}
+ /*}}}*/
+// InitCache - initialize the package cache /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool Go(CommandLine &CmdL)
+{
+ // Initialize the apt cache
+ MMap *Map = 0;
+ pkgSourceList List;
+ List.ReadMainList();
+ pkgCacheGenerator::MakeStatusCache(List,NULL,&Map,true);
+ if (Map == 0)
+ return false;
+ DebFile::Cache = new pkgCache(Map);
+ if (_error->PendingError() == true)
+ return false;
+
+ // Find out what version of debconf is currently installed
+ string debconfver = DebFile::GetInstalledVer("debconf");
+ if (debconfver.empty() == true)
+ return _error->Error( _("Cannot get debconf version. Is debconf installed?"));
+
+ // Process each package passsed in
+ for (unsigned int I = 0; I != CmdL.FileSize(); I++)