mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Introduce pkglist format
This allows us to check and reconfigure if the pkglist format is not current
This commit is contained in:
parent
29aa336199
commit
d213b72978
@ -185,6 +185,8 @@
|
||||
\newwrite{\layouts} \immediate\openout \layouts = textclass.lst.tmp
|
||||
\newwrite{\vars} \immediate\openout \vars = chkconfig.vars
|
||||
\newwrite{\packages} \immediate\openout \packages = packages.lst.tmp
|
||||
% Version of the packages list
|
||||
\immediate\write\packages{!!fileformat 2}
|
||||
|
||||
\immediate\write\layouts{%
|
||||
# This file declares layouts and their associated definition files.^^J%
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "support/FileName.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/Package.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
@ -51,6 +52,7 @@ void LaTeXPackages::getAvailable()
|
||||
packages_.clear();
|
||||
|
||||
bool finished = false;
|
||||
string lstformat = "1";
|
||||
// Parse config-file
|
||||
while (lex.isOK() && !finished) {
|
||||
switch (lex.lex()) {
|
||||
@ -62,10 +64,20 @@ void LaTeXPackages::getAvailable()
|
||||
// Parse optional version info
|
||||
lex.eatLine();
|
||||
string const v = trim(lex.getString());
|
||||
if (p == "!!fileformat") {
|
||||
lstformat = v;
|
||||
continue;
|
||||
}
|
||||
packages_.insert(make_pair(p, v));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check if the pkglist has current format.
|
||||
// Reconfigure and re-parse if not.
|
||||
if (lstformat != "2") {
|
||||
package().reconfigureUserLyXDir("");
|
||||
getAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user