mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Do not run bibtex when not necessary
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1528 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c758a9f2dd
commit
3d4b640a42
@ -1,3 +1,12 @@
|
||||
2001-02-17 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* LaTeX.C (run): Do not use 'scanres & RERUN' when deciding
|
||||
whether to run bibtex.
|
||||
|
||||
2001-02-16 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* Makefile.am (lyx_SOURCES): Remove BackStack.h
|
||||
|
||||
2001-02-16 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* Makefile.am (lyx_SOURCES): removed bibforms.h
|
||||
|
33
src/LaTeX.C
33
src/LaTeX.C
@ -113,7 +113,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
// in it. However it seems safe to run latex (at least) on time each
|
||||
// time the .tex file changes.
|
||||
{
|
||||
int scanres = LaTeX::NO_ERRORS;
|
||||
int scanres = NO_ERRORS;
|
||||
unsigned int count = 0; // number of times run
|
||||
num_errors = 0; // just to make sure.
|
||||
const unsigned int MAX_RUN = 6;
|
||||
@ -154,7 +154,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
head.update();
|
||||
if (!head.sumchange()) {
|
||||
lyxerr[Debug::DEPEND] << "return no_change" << endl;
|
||||
return LaTeX::NO_CHANGE;
|
||||
return NO_CHANGE;
|
||||
}
|
||||
lyxerr[Debug::DEPEND]
|
||||
<< "Dependency file has changed" << endl;
|
||||
@ -177,13 +177,13 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERROR_RERUN) {
|
||||
if (scanres & ERROR_RERUN) {
|
||||
lyxerr[Debug::LATEX] << "Rerunning LaTeX" << endl;
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
}
|
||||
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
if (scanres & ERRORS) {
|
||||
deleteFilesOnError();
|
||||
return scanres; // return on error
|
||||
}
|
||||
@ -212,9 +212,8 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
}
|
||||
|
||||
// run bibtex
|
||||
if (scanres & LaTeX::UNDEF_CIT
|
||||
|| scanres & LaTeX::RERUN
|
||||
|| run_bibtex) {
|
||||
// if (scanres & UNDEF_CIT || scanres & RERUN || run_bibtex)
|
||||
if (scanres & UNDEF_CIT || run_bibtex) {
|
||||
// Here we must scan the .aux file and look for
|
||||
// "\bibdata" and/or "\bibstyle". If one of those
|
||||
// tags is found -> run bibtex and set rerun = true;
|
||||
@ -252,7 +251,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
if (scanres & ERRORS) {
|
||||
deleteFilesOnError();
|
||||
return scanres; // return on error
|
||||
}
|
||||
@ -290,7 +289,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
// -> rerun not asked for:
|
||||
// just return (fall out of bottom of func)
|
||||
//
|
||||
while ((head.sumchange() || rerun || (scanres & LaTeX::RERUN))
|
||||
while ((head.sumchange() || rerun || (scanres & RERUN))
|
||||
&& count < MAX_RUN) {
|
||||
// Yes rerun until message goes away, or until
|
||||
// MAX_RUNS are reached.
|
||||
@ -300,7 +299,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||
WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
|
||||
this->operator()();
|
||||
scanres = scanLogFile(terr);
|
||||
if (scanres & LaTeX::ERRORS) {
|
||||
if (scanres & ERRORS) {
|
||||
deleteFilesOnError();
|
||||
return scanres; // return on error
|
||||
}
|
||||
@ -585,7 +584,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
|
||||
retval |= TEX_WARNING;
|
||||
} else if (contains(token, "Rerun to get citations")) {
|
||||
// Natbib seems to use this.
|
||||
retval |= RERUN;
|
||||
retval |= UNDEF_CIT;
|
||||
} else if (contains(token, "No pages of output")) {
|
||||
// A dvi file was not created
|
||||
retval |= NO_OUTPUT;
|
||||
@ -665,12 +664,11 @@ void LaTeX::deplog(DepTable & head)
|
||||
// since this file can not be a file generated by
|
||||
// the latex run.
|
||||
head.insert(foundfile, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
// (2) foundfile is in the tmpdir
|
||||
// insert it into head
|
||||
if (FileInfo(OnlyFilename(foundfile)).exist()) {
|
||||
else if (FileInfo(OnlyFilename(foundfile)).exist()) {
|
||||
if (unwanted.exact_match(foundfile)) {
|
||||
lyxerr[Debug::DEPEND]
|
||||
<< "We don't want "
|
||||
@ -693,10 +691,9 @@ void LaTeX::deplog(DepTable & head)
|
||||
<< endl;
|
||||
head.insert(OnlyFilename(foundfile));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
lyxerr[Debug::DEPEND]
|
||||
<< "Not a file or we are unable to find it."
|
||||
<< endl;
|
||||
} else
|
||||
lyxerr[Debug::DEPEND]
|
||||
<< "Not a file or we are unable to find it."
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user