Skip to content

Commit afc113c

Browse files
committed
adapt packageScan to changed miktex behaviour
1 parent fc919f1 commit afc113c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/kpathseaParser.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,20 @@ QStringList MiktexPackageScanner::stysForPackage(const QString &pck)
133133
bool inRunTimeFilesSection = false;
134134
foreach (const QString &l, lines) {
135135
if (!inRunTimeFilesSection) {
136-
if (l.startsWith("run-time files:"))
136+
if (l.startsWith("run-time files:")){
137137
inRunTimeFilesSection = true;
138+
// new output format has everything in the same line.
139+
QString rest=l.mid(16);
140+
// split at semicolon
141+
QStringList styles=rest.split(';');
142+
foreach(auto fn,styles){
143+
fn = QFileInfo(fn).fileName();
144+
if (fn.endsWith(".sty") || fn.endsWith(".cls")) {
145+
fn.chop(4);
146+
result.append(fn);
147+
}
148+
}
149+
}
138150
continue;
139151
} else {
140152
QString fn = l.simplified();
@@ -161,7 +173,7 @@ void MiktexPackageScanner::run()
161173
return;
162174
QStringList parts = pck.simplified().split(" "); // output format of "mpm --list": installation status, number of files, size, database name
163175
if (parts.count() != 4) continue;
164-
if (parts[0] != "i") continue; // not installed
176+
if (parts[0] != "i" && parts[0].toLower() != "true") continue; // not installed
165177
pck = parts[3];
166178
QStringList stys;
167179
if (cachedStys.contains(pck)) {

0 commit comments

Comments
 (0)