Wednesday, February 7, 2024

[SOLVED] How to get file list from a Debian package using eptlib libraries?

Issue

Simple question: I have loaded an Apt package record with libept. There is a method to get file list? It should sound like

 record.GetFileList();

and it should return a vector string like the output of

 dpkg -L packagename

Solution

The libept main developer (Petr Rockai) explain me that unfortunately, at this time, libept have no such method. What they do in Adept is this:

QString flfilename = "/var/lib/dpkg/info/" + u8(t.package()) + ".list";
QFile flfile(flfilename);

QTextStream flInStream(&flfile);
while (!flInStream.atEnd()) {
   QString line = flInStream.readLine();
   // do stuff with line
}
flfile.close();


Answered By - Emilio
Answer Checked By - Senaida (WPSolving Volunteer)