- string full_l =
- findtexfile(
- ChangeExtension(style, "bst", false),
- "bst");
- lyxerr << "style = `"
- << full_l << "'" << endl;
- if (!full_l.empty()) {
- // add full_l to the dep file.
- dep.insert(full_l, true);
- }
+ style = ChangeExtension(style, "bst");
+ lyxerr[Debug::LATEX] << "BibTeX style: `"
+ << style << '\'' << endl;
+ aux_info.styles.insert(style);
+ } else if (regex_match(token, sub, reg4)) {
+ string const file2 = sub.str(1);
+ scanAuxFile(file2, aux_info);
+ }
+ }
+}
+
+
+void LaTeX::updateBibtexDependencies(DepTable & dep,
+ vector<Aux_Info> const & bibtex_info)
+{
+ // Since a run of Bibtex mandates more latex runs it is ok to
+ // remove all ".bib" and ".bst" files.
+ dep.remove_files_with_extension(".bib");
+ dep.remove_files_with_extension(".bst");
+ //string aux = OnlyFilename(ChangeExtension(file, ".aux"));
+
+ for (vector<Aux_Info>::const_iterator it = bibtex_info.begin();
+ it != bibtex_info.end(); ++it) {
+ for (set<string>::const_iterator it2 = it->databases.begin();
+ it2 != it->databases.end(); ++it2) {
+ string file = findtexfile(*it2, "bib");
+ if (!file.empty())
+ dep.insert(file, true);
+ }
+
+ for (set<string>::const_iterator it2 = it->styles.begin();
+ it2 != it->styles.end(); ++it2) {
+ string file = findtexfile(*it2, "bst");
+ if (!file.empty())
+ dep.insert(file, true);