probonopd 7 years ago
committed by GitHub
parent
commit
717eebcaf7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      tools/linuxdeployqt/shared.cpp

14
tools/linuxdeployqt/shared.cpp

@ -291,7 +291,7 @@ bool copyCopyrightFile(QString libPath){
} }
QString dpkgQueryPath; QString dpkgQueryPath;
dpkgQueryPath = QStandardPaths::findExecutable("dpkg"); dpkgQueryPath = QStandardPaths::findExecutable("dpkg-query");
if(dpkgQueryPath == ""){ if(dpkgQueryPath == ""){
LogNormal() << "dpkg-query not found, hence not deploying copyright files"; LogNormal() << "dpkg-query not found, hence not deploying copyright files";
return false; return false;
@ -301,19 +301,17 @@ bool copyCopyrightFile(QString libPath){
/* Find out which package the file being deployed belongs to */ /* Find out which package the file being deployed belongs to */
QString program = "dpkg";
QStringList arguments; QStringList arguments;
arguments << "-S" << libPath; arguments << "-S" << libPath;
QProcess *myProcess = new QProcess(); QProcess *myProcess = new QProcess();
myProcess->start(program, arguments); myProcess->start(dpkgPath, arguments);
myProcess->waitForFinished(); myProcess->waitForFinished();
QString strOut = myProcess->readAllStandardOutput().split(':')[0]; QString strOut = myProcess->readAllStandardOutput().split(':')[0];
if(strOut == "") return false; if(strOut == "") return false;
/* Find out the copyright file in that package */ /* Find out the copyright file in that package */
program = "dpkg-query";
arguments << "-L" << strOut; arguments << "-L" << strOut;
myProcess->start(program, arguments); myProcess->start(dpkgQueryPath, arguments);
myProcess->waitForFinished(); myProcess->waitForFinished();
strOut = myProcess->readAllStandardOutput(); strOut = myProcess->readAllStandardOutput();
@ -321,8 +319,10 @@ bool copyCopyrightFile(QString libPath){
foreach (QString outputLine, outputLines) { foreach (QString outputLine, outputLines) {
if((outputLine.contains("usr/share/doc")) && (outputLine.contains("/copyright")) && (outputLine.contains(" "))){ if((outputLine.contains("usr/share/doc")) && (outputLine.contains("/copyright")) && (outputLine.contains(" "))){
copyrightFilePath = outputLine.split(' ')[1]; // copyrightFilePath = outputLine.split(' ')[1]; // This is not working on multiarch systems; see https://github.com/probonopd/linuxdeployqt/issues/184#issuecomment-345293540
break; QStringList parts = outputLine.split(' ');
copyrightFilePath = parts[parts.size() - 1]; // Grab last element
break;
} }
} }

Loading…
Cancel
Save