Description: Use dpkg to identify the architecture to use
 The upstream check is not reliable because if you run i386
 with a 64 bit kernel, you download the wrong binaries.
 .
 This patch is Debian specific since it relies on dpkg and thus can't be
 upstreamed.
Author: Raphaël Hertzog <hertzog@debian.org>
Origin: vendor
Forwarded: not-needed

--- a/caja-dropbox.in
+++ b/caja-dropbox.in
@@ -128,13 +128,13 @@
 
 def plat():
     if sys.platform.lower().startswith('linux'):
-        arch = platform.machine()
-        if (arch[0] == 'i' and
-            arch[1].isdigit() and
-            arch[2:4] == '86'):
+        arch = subprocess.Popen(["dpkg", "--print-architecture"],
+                                stdout=subprocess.PIPE).communicate()[0]
+        arch = arch.rstrip(b"\n")
+        if arch == b"i386":
             plat = "x86"
-        elif arch == 'x86_64':
-            plat = arch
+        elif arch == b"amd64":
+            plat = "x86_64"
         else:
             FatalVisibleError("Platform not supported")
         return "lnx.%s" % plat
