diff 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
line wrap: on
line diff
--- a/ui/createinstallerdialog.cpp	Fri Aug 08 10:49:16 2014 +0200
+++ b/ui/createinstallerdialog.cpp	Fri Aug 08 10:56:24 2014 +0200
@@ -247,22 +247,31 @@
                 .arg(linuxDir.path()));
         return;
     }
-    if (candidates.size() > 1) {
-        showErrorMessage(tr("Unexpected additional .sh files in: %1")
-                .arg(linuxDir.path()));
-        return;
-    }
-    mProgress.setLabelText(tr("Signing Linux package..."));
-    mProgress.cancel();
 
-    QString outFileName = options.value("setupname", "TrustBridge-default.exe"
-            ).toString().replace(".exe", ".sh").arg(QString());
+    foreach (const QString& candidate, candidates) {
+        mProgress.setLabelText(tr("Signing Linux package..."));
+        mProgress.cancel();
 
-    if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidates.first(),
-                outDir.path() + "/" + outFileName)) {
-        qDebug() << "Failed to sign linux package.";
-        mProgress.close();
-        return;
+        bool x86arch;
+        if (candidate.endsWith("-i386.sh")) {
+            x86arch = true;
+        } else if (candidate.endsWith("-amd64.sh")) {
+            x86arch = false;
+        } else {
+            qDebug() << "Could not detrmine architecture of " << candidate;
+            qDebug() << "Skipping.";
+        }
+
+        QString outFileName = options.value("setupname", "TrustBridge-default.exe"
+                ).toString().replace(".exe",
+                    x86arch ? "-x86arch.sh" : "-64bit.sh").arg(QString());
+
+        if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidate,
+                    outDir.path() + "/" + outFileName)) {
+            showErrorMessage(tr("Failed to sign linux package: %1").arg(candidate));
+            mProgress.close();
+            return;
+        }
     }
 
     /* The Windows installer */

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