comparison ui/createinstallerdialog.cpp @ 885:1cc85fd3daa5

(issue70) Handle i386 and amd64 packages
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 08 Aug 2014 10:56:24 +0200
parents ecdc279dea15
children 197c594aad2b
comparison
equal deleted inserted replaced
884:6abf8e77cd5f 885:1cc85fd3daa5
245 if (candidates.isEmpty()) { 245 if (candidates.isEmpty()) {
246 showErrorMessage(tr("Failed to find a readable *.sh file in: %1") 246 showErrorMessage(tr("Failed to find a readable *.sh file in: %1")
247 .arg(linuxDir.path())); 247 .arg(linuxDir.path()));
248 return; 248 return;
249 } 249 }
250 if (candidates.size() > 1) { 250
251 showErrorMessage(tr("Unexpected additional .sh files in: %1") 251 foreach (const QString& candidate, candidates) {
252 .arg(linuxDir.path())); 252 mProgress.setLabelText(tr("Signing Linux package..."));
253 return; 253 mProgress.cancel();
254 } 254
255 mProgress.setLabelText(tr("Signing Linux package...")); 255 bool x86arch;
256 mProgress.cancel(); 256 if (candidate.endsWith("-i386.sh")) {
257 257 x86arch = true;
258 QString outFileName = options.value("setupname", "TrustBridge-default.exe" 258 } else if (candidate.endsWith("-amd64.sh")) {
259 ).toString().replace(".exe", ".sh").arg(QString()); 259 x86arch = false;
260 260 } else {
261 if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidates.first(), 261 qDebug() << "Could not detrmine architecture of " << candidate;
262 outDir.path() + "/" + outFileName)) { 262 qDebug() << "Skipping.";
263 qDebug() << "Failed to sign linux package."; 263 }
264 mProgress.close(); 264
265 return; 265 QString outFileName = options.value("setupname", "TrustBridge-default.exe"
266 ).toString().replace(".exe",
267 x86arch ? "-x86arch.sh" : "-64bit.sh").arg(QString());
268
269 if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidate,
270 outDir.path() + "/" + outFileName)) {
271 showErrorMessage(tr("Failed to sign linux package: %1").arg(candidate));
272 mProgress.close();
273 return;
274 }
266 } 275 }
267 276
268 /* The Windows installer */ 277 /* The Windows installer */
269 278
270 mCurrentWorkingDir = codesignBinaries(binDir.path() + "/windows"); 279 mCurrentWorkingDir = codesignBinaries(binDir.path() + "/windows");

http://wald.intevation.org/projects/trustbridge/