diff -Nru nautilus-dropbox-0.7.1/configure nautilus-dropbox-1.6.1/configure --- nautilus-dropbox-0.7.1/configure 2011-11-11 21:14:00.000000000 +0000 +++ nautilus-dropbox-1.6.1/configure 2013-12-18 16:56:50.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for nautilus-dropbox 0.7.1. +# Generated by GNU Autoconf 2.64 for nautilus-dropbox 1.6.1. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -695,8 +695,8 @@ # Identity of this package. PACKAGE_NAME='nautilus-dropbox' PACKAGE_TARNAME='nautilus-dropbox' -PACKAGE_VERSION='0.7.1' -PACKAGE_STRING='nautilus-dropbox 0.7.1' +PACKAGE_VERSION='1.6.1' +PACKAGE_STRING='nautilus-dropbox 1.6.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1426,7 +1426,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures nautilus-dropbox 0.7.1 to adapt to many kinds of systems. +\`configure' configures nautilus-dropbox 1.6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1497,7 +1497,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of nautilus-dropbox 0.7.1:";; + short | recursive ) echo "Configuration of nautilus-dropbox 1.6.1:";; esac cat <<\_ACEOF @@ -1606,7 +1606,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -nautilus-dropbox configure 0.7.1 +nautilus-dropbox configure 1.6.1 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1884,7 +1884,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by nautilus-dropbox $as_me 0.7.1, which was +It was created by nautilus-dropbox $as_me 1.6.1, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -2693,7 +2693,7 @@ # Define the identity of the package. PACKAGE=nautilus-dropbox - VERSION=0.7.1 + VERSION=1.6.1 cat >>confdefs.h <<_ACEOF @@ -11466,7 +11466,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by nautilus-dropbox $as_me 0.7.1, which was +This file was extended by nautilus-dropbox $as_me 1.6.1, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11530,7 +11530,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -nautilus-dropbox config.status 0.7.1 +nautilus-dropbox config.status 1.6.1 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru nautilus-dropbox-0.7.1/configure.in nautilus-dropbox-1.6.1/configure.in --- nautilus-dropbox-0.7.1/configure.in 2011-11-11 21:13:56.000000000 +0000 +++ nautilus-dropbox-1.6.1/configure.in 2013-12-17 13:11:00.000000000 +0000 @@ -1,6 +1,6 @@ # Initialization -AC_INIT([nautilus-dropbox],0.7.1) +AC_INIT([nautilus-dropbox],1.6.1) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) diff -Nru nautilus-dropbox-0.7.1/COPYING nautilus-dropbox-1.6.1/COPYING --- nautilus-dropbox-0.7.1/COPYING 2011-10-20 02:27:53.000000000 +0000 +++ nautilus-dropbox-1.6.1/COPYING 2013-01-23 22:20:59.000000000 +0000 @@ -1,4 +1,4 @@ -nautilus-dropbox is copyright 2008-2011 Dropbox, Inc. +nautilus-dropbox is copyright 2008-2012 Dropbox, Inc. All images included in this package constitute data and are licensed under the Creative Commons Attribution-No Derivative Works 3.0 Unported License [1]. This diff -Nru nautilus-dropbox-0.7.1/debian/changelog nautilus-dropbox-1.6.1/debian/changelog --- nautilus-dropbox-0.7.1/debian/changelog 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/changelog 2014-09-19 14:45:35.000000000 +0000 @@ -1,3 +1,63 @@ +nautilus-dropbox (1.6.1-1) precise; urgency=low + + * [2e7146f] Fix missing colour output in dropbox (Closes: #730656) + * [fba6519] Imported Upstream version 1.6.1 + * [a4e21c3] Drop fix-colour-output.patch (upstreamed) + * [864fd02] No-change bump of Standards-Version to 3.9.5 + + -- Attila Hammer Thu, 02 Jan 2014 23:01:48 +0800 + +nautilus-dropbox (1.6.0-2) unstable; urgency=low + + * [207aa03] Add recommends on libappindicator1. + Turns out dropbox uses it when it detects an appindicator-based environment. + Thanks to Mattia Rizzolo (LP: #1242413) + + -- Chow Loong Jin Thu, 07 Nov 2013 12:10:09 +0800 + +nautilus-dropbox (1.6.0-1) unstable; urgency=low + + * [634af0b] Imported Upstream version 1.6.0 + * [b26e718] Update maintainer field. + Taken over maintainership of nautilus-dropbox with Raphaël's approval. + * [d99f903] Update copyright year for Dropbox + * [14c937a] Document copyright for myself + * [d288ece] No-change bump of Standards-Version to 3.9.4 + * [3230f36] Redo display-error-string-when-download-failed.patch + dropbox.in seems to have undergone quite a number of changes, so reimplement + this feature on top of it. + * [dc5ac7c] Refresh patches + + -- Chow Loong Jin Sun, 22 Sep 2013 18:23:03 +0800 + +nautilus-dropbox (1.4.0-3) unstable; urgency=low + + * Add "Conflicts: dropbox" since dropbox (the company) renamed + their nautilus-dropbox into dropbox, and the same software is + now packaged under two package names. Closes: #686863 + + -- Raphaël Hertzog Fri, 07 Sep 2012 08:04:57 +0200 + +nautilus-dropbox (1.4.0-2) unstable; urgency=low + + * Update add-http-proxy-option.patch and use-pkexec-to-get-root- + rights.patch to support and handle --https-proxy option too. Dropbox + now redirects the download URL to an https URL so it might be needed + to get the download working in some situations. + * Add display-error-string-when-download-failed.patch to provide more + information when the download failed. It makes it easier to respond + to user support requests. + + -- Raphaël Hertzog Sun, 12 Aug 2012 15:40:00 +0200 + +nautilus-dropbox (1.4.0-1) unstable; urgency=low + + * New upstream release (without any change... just to increase + the version number above the version that was in Ubuntu LTS). + * Update Standards-Version to 3.9.3 (no change needed). + + -- Raphaël Hertzog Mon, 09 Jul 2012 09:49:31 +0200 + nautilus-dropbox (0.7.1-2) unstable; urgency=low * Update watch file to cope with changes on the dropbox website. diff -Nru nautilus-dropbox-0.7.1/debian/control nautilus-dropbox-1.6.1/debian/control --- nautilus-dropbox-0.7.1/debian/control 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/control 2014-01-02 15:01:54.000000000 +0000 @@ -1,9 +1,9 @@ Source: nautilus-dropbox Section: non-free/gnome Priority: optional -Maintainer: Raphaël Hertzog +Maintainer: Chow Loong Jin Build-Depends: debhelper (>= 8), libnautilus-extension-dev (>= 2.16.0), libglib2.0-dev (>= 2.14.0), python-gtk2 (>= 2.12), python-docutils (>= 0.6), python (>= 2.6.6-3~), dh-autoreconf -Standards-Version: 3.9.2 +Standards-Version: 3.9.5 XS-Autobuild: yes Homepage: http://www.dropbox.com/ Vcs-Git: git://git.debian.org/collab-maint/nautilus-dropbox.git @@ -12,7 +12,9 @@ Package: nautilus-dropbox Architecture: i386 amd64 Depends: procps, python-gtk2 (>= 2.12), python-gpgme, policykit-1, ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} +Recommends: libappindicator1 Suggests: nautilus +Conflicts: dropbox Description: Dropbox integration for Nautilus Nautilus Dropbox is an extension that integrates the Dropbox web service with your GNOME Desktop. diff -Nru nautilus-dropbox-0.7.1/debian/copyright nautilus-dropbox-1.6.1/debian/copyright --- nautilus-dropbox-0.7.1/debian/copyright 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/copyright 2014-01-02 15:01:54.000000000 +0000 @@ -22,7 +22,7 @@ License: GPL-3+ Files: *.png -Copyright: 2008-2011, Dropbox, Inc. +Copyright: 2008-2012, Dropbox, Inc. License: CC-BY-ND-3.0 Comment: All images included in this package constitute data and are licensed @@ -34,7 +34,8 @@ This module has been placed in the public domain. Files: debian/* -Copyright: 2011, Raphaël Hertzog +Copyright: 2013, Chow Loong Jin + 2011, Raphaël Hertzog 2008, Rian Hunter License: GPL-3+ diff -Nru nautilus-dropbox-0.7.1/debian/patches/add-http-proxy-option.patch nautilus-dropbox-1.6.1/debian/patches/add-http-proxy-option.patch --- nautilus-dropbox-0.7.1/debian/patches/add-http-proxy-option.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/add-http-proxy-option.patch 2014-01-02 15:01:54.000000000 +0000 @@ -5,9 +5,11 @@ Origin: vendor Bug-Debian: http://bugs.debian.org/651065 ---- a/dropbox.in -+++ b/dropbox.in -@@ -1351,8 +1351,15 @@ def main(argv): +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:12:00.917424057 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:12:00.912424081 +0800 +@@ -1394,8 +1394,22 @@ os._exit(0) return @@ -18,9 +20,16 @@ + # Need to reset _urlopener to take the new value into account + urllib._urlopener = DropboxURLopener() + ++ def set_https_proxy(option, opt_str, value, parser): ++ os.environ["https_proxy"] = value ++ # Need to reset _urlopener to take the new value into account ++ urllib._urlopener = DropboxURLopener() ++ globaloptionparser = optparse.OptionParser() + globaloptionparser.add_option("--http-proxy", action="callback", + type="string", callback=set_http_proxy) ++ globaloptionparser.add_option("--https-proxy", action="callback", ++ type="string", callback=set_https_proxy) globaloptionparser.parse_args(argv[0:i]) # now dispatch and run diff -Nru nautilus-dropbox-0.7.1/debian/patches/display-error-string-when-download-failed.patch nautilus-dropbox-1.6.1/debian/patches/display-error-string-when-download-failed.patch --- nautilus-dropbox-0.7.1/debian/patches/display-error-string-when-download-failed.patch 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/display-error-string-when-download-failed.patch 2014-01-02 15:01:54.000000000 +0000 @@ -0,0 +1,90 @@ +Description: Give more info about download failures + When you have to diagnose download failures, you need some basic + information about the user's configuration. Print those + information in the error message. +Author: Raphaël Hertzog +Origin: vendor +Forwarded: no +Last-Update: 2012-08-08 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:30:13.973940638 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:31:12.486766147 +0800 +@@ -236,17 +236,27 @@ + else: + raise + ++def get_download_debug_info(url, e): ++ msg = "\nURL that failed to download: %s\nError: %s\n" % (url, e.strerror) ++ if "http_proxy" in os.environ: ++ msg += "http_proxy = %s" % os.environ["http_proxy"] ++ if "https_proxy" in os.environ: ++ msg += "https_proxy = %s" % os.environ["https_proxy"] ++ return msg ++ + class DownloadState(object): + def __init__(self): + self.local_file = StringIO.StringIO() + + def copy_data(self): +- return download_file_chunk(DOWNLOAD_LOCATION_FMT % plat(), self.local_file) ++ self.url = DOWNLOAD_LOCATION_FMT % plat() ++ return download_file_chunk(self.url , self.local_file) + + def unpack(self): + # download signature + signature = StringIO.StringIO() +- for _ in download_file_chunk(SIGNATURE_LOCATION_FMT % plat(), signature): ++ self.url = SIGNATURE_LOCATION_FMT % plat() ++ for _ in download_file_chunk(self.url, signature): + pass + signature.seek(0) + self.local_file.seek(0) +@@ -373,7 +383,9 @@ + self.unpack_dropbox() + + def error(ex): +- FatalVisibleError(ERROR_CONNECTING) ++ FatalVisibleError(ERROR_CONNECTING + "\n" + ++ get_download_debug_info( ++ self.download.url, ex)) + + self.update_progress(DOWNLOADING, 0) + self.task = GeneratorTask(self.download.copy_data, +@@ -396,7 +408,9 @@ + if isinstance(ex, SignatureVerifyError): + FatalVisibleError(ERROR_SIGNATURE) + else: +- FatalVisibleError(ERROR_CONNECTING) ++ FatalVisibleError(ERROR_CONNECTING + "\n" + ++ get_download_debug_info( ++ self.download.url,ex)) + + self.task = GeneratorTask(self.download.unpack, + unpack_progress, +@@ -556,8 +570,9 @@ + if not status: + break + setprogress(DOWNLOADING, progress) +- except Exception: +- FatalVisibleError(ERROR_CONNECTING) ++ except Exception as ex: ++ FatalVisibleError(ERROR_CONNECTING + "\n" + ++ get_download_debug_info(download.url, ex)) + else: + setprogress(DOWNLOADING, 1.0) + console_print() +@@ -568,8 +583,9 @@ + setprogress(UNPACKING, float(i)/total) + except SignatureVerifyError: + FatalVisibleError(ERROR_SIGNATURE) +- except Exception: +- FatalVisibleError(ERROR_CONNECTING) ++ except Exception as e: ++ FatalVisibleError(ERROR_CONNECTING + "\n" + ++ get_download_debug_info(download.url, ex)) + else: + setprogress(UNPACKING, 1.0) + diff -Nru nautilus-dropbox-0.7.1/debian/patches/do-not-hardcode-dropboxd-path.patch nautilus-dropbox-1.6.1/debian/patches/do-not-hardcode-dropboxd-path.patch --- nautilus-dropbox-0.7.1/debian/patches/do-not-hardcode-dropboxd-path.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/do-not-hardcode-dropboxd-path.patch 2014-01-02 15:01:54.000000000 +0000 @@ -2,9 +2,11 @@ Author: Raphaël Hertzog Origin: vendor ---- a/dropbox.in -+++ b/dropbox.in -@@ -702,7 +702,7 @@ def requires_dropbox_running(meth): +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:11:59.514431168 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:11:59.509431193 +0800 +@@ -726,7 +726,7 @@ return newmeth def start_dropbox(): diff -Nru nautilus-dropbox-0.7.1/debian/patches/dropbox-update.patch nautilus-dropbox-1.6.1/debian/patches/dropbox-update.patch --- nautilus-dropbox-0.7.1/debian/patches/dropbox-update.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/dropbox-update.patch 2014-01-02 15:01:54.000000000 +0000 @@ -4,9 +4,11 @@ Author: Raphaël Hertzog Origin: vendor ---- a/dropbox.in -+++ b/dropbox.in -@@ -799,6 +799,15 @@ def columnize(list, display_list=None, d +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:11:59.970428855 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:11:59.966428876 +0800 +@@ -822,6 +822,15 @@ console_print(line) @command diff -Nru nautilus-dropbox-0.7.1/debian/patches/non-interactive-update.patch nautilus-dropbox-1.6.1/debian/patches/non-interactive-update.patch --- nautilus-dropbox-0.7.1/debian/patches/non-interactive-update.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/non-interactive-update.patch 2014-01-02 15:01:54.000000000 +0000 @@ -7,9 +7,11 @@ Forwarded: not-needed Origin: vendor ---- a/dropbox.in -+++ b/dropbox.in -@@ -526,9 +526,6 @@ else: +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:12:02.581415633 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:12:02.576415658 +0800 +@@ -561,9 +561,6 @@ console_print(u"%s %s\n" % (INFO, LINK)) GPG_WARNING_MSG = (u"\n%s" % GPG_WARNING) if not gpgme else u"" @@ -17,5 +19,5 @@ - return - download = DownloadState() - one_chunk = download.copy_data() + try: diff -Nru nautilus-dropbox-0.7.1/debian/patches/series nautilus-dropbox-1.6.1/debian/patches/series --- nautilus-dropbox-0.7.1/debian/patches/series 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/series 2014-01-02 15:01:54.000000000 +0000 @@ -1,6 +1,7 @@ unlink-before-extract.patch do-not-hardcode-dropboxd-path.patch dropbox-update.patch +display-error-string-when-download-failed.patch # Patches above should really be integrated upstream add-http-proxy-option.patch use-var-lib-dropbox.patch diff -Nru nautilus-dropbox-0.7.1/debian/patches/unlink-before-extract.patch nautilus-dropbox-1.6.1/debian/patches/unlink-before-extract.patch --- nautilus-dropbox-0.7.1/debian/patches/unlink-before-extract.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/unlink-before-extract.patch 2014-01-02 15:01:54.000000000 +0000 @@ -4,9 +4,11 @@ Author: Raphaël Hertzog Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nautilus-dropbox/+bug/818014 ---- a/dropbox.in -+++ b/dropbox.in -@@ -271,6 +271,9 @@ class DownloadState(object): +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:11:59.078433379 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:11:59.074433400 +0800 +@@ -259,6 +259,9 @@ archive = tarfile.open(fileobj=self.local_file, mode='r:gz') total_members = len(archive.getmembers()) for i, member in enumerate(archive.getmembers()): diff -Nru nautilus-dropbox-0.7.1/debian/patches/use-dpkg-to-select-platform.patch nautilus-dropbox-1.6.1/debian/patches/use-dpkg-to-select-platform.patch --- nautilus-dropbox-0.7.1/debian/patches/use-dpkg-to-select-platform.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/use-dpkg-to-select-platform.patch 2014-01-02 15:01:54.000000000 +0000 @@ -8,9 +8,11 @@ Origin: vendor Forwarded: not-needed ---- a/dropbox.in -+++ b/dropbox.in -@@ -139,13 +139,13 @@ def yes_no_question(question): +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:12:03.068413169 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:12:03.064413189 +0800 +@@ -145,13 +145,13 @@ def plat(): if sys.platform.lower().startswith('linux'): diff -Nru nautilus-dropbox-0.7.1/debian/patches/use-pkexec-to-get-root-rights.patch nautilus-dropbox-1.6.1/debian/patches/use-pkexec-to-get-root-rights.patch --- nautilus-dropbox-0.7.1/debian/patches/use-pkexec-to-get-root-rights.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/use-pkexec-to-get-root-rights.patch 2014-01-02 15:01:54.000000000 +0000 @@ -4,9 +4,11 @@ Author: Raphaël Hertzog Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nautilus-dropbox/+bug/821212 ---- a/dropbox.in -+++ b/dropbox.in -@@ -1239,7 +1239,14 @@ options: +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:12:01.912419018 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:12:01.907419043 +0800 +@@ -1282,7 +1282,16 @@ # install dropbox!!! try: @@ -14,11 +16,13 @@ + args = [ "pkexec", "dropbox" ] + if "http_proxy" in os.environ: + args.extend(["--http-proxy", os.environ["http_proxy"]]) ++ if "https_proxy" in os.environ: ++ args.extend(["--https-proxy", os.environ["https_proxy"]]) + args.append("update") + status = os.spawnvp(os.P_WAIT, "pkexec", args) + if status != 0: + console_print(u"The installation of Dropbox failed.") + return except: - pass + traceback.print_exc() else: diff -Nru nautilus-dropbox-0.7.1/debian/patches/use-var-lib-dropbox.patch nautilus-dropbox-1.6.1/debian/patches/use-var-lib-dropbox.patch --- nautilus-dropbox-0.7.1/debian/patches/use-var-lib-dropbox.patch 2011-12-28 11:38:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/debian/patches/use-var-lib-dropbox.patch 2014-01-02 15:01:54.000000000 +0000 @@ -9,9 +9,11 @@ Author: Raphaël Hertzog Origin: vendor ---- a/dropbox.in -+++ b/dropbox.in -@@ -54,7 +54,7 @@ GPG_WARNING = u"Note: python-gpgme is no +Index: nautilus-dropbox/dropbox.in +=================================================================== +--- nautilus-dropbox.orig/dropbox.in 2013-09-23 02:12:01.433421443 +0800 ++++ nautilus-dropbox/dropbox.in 2013-09-23 02:12:01.428421468 +0800 +@@ -60,7 +60,7 @@ DOWNLOADING = u"Downloading Dropbox... %d%%" UNPACKING = u"Unpacking Dropbox... %d%%" @@ -20,7 +22,7 @@ DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR DESKTOP_FILE = u"@DESKTOP_FILE_DIR@/dropbox.desktop" -@@ -275,6 +275,7 @@ class DownloadState(object): +@@ -273,6 +273,7 @@ if os.path.exists(filename) and not os.path.isdir(filename): os.unlink(filename) archive.extract(member, PARENT_DIR) diff -Nru nautilus-dropbox-0.7.1/dropbox.in nautilus-dropbox-1.6.1/dropbox.in --- nautilus-dropbox-0.7.1/dropbox.in 2011-11-11 21:13:56.000000000 +0000 +++ nautilus-dropbox-1.6.1/dropbox.in 2013-12-17 13:11:00.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright 2008 Evenflow, Inc. +# Copyright (c) Dropbox, Inc. # # dropbox # Dropbox frontend script @@ -22,7 +22,6 @@ from __future__ import with_statement import errno -import fcntl import locale import optparse import os @@ -35,8 +34,10 @@ import tarfile import tempfile import threading +import thread import time -import urllib +import traceback +import urllib2 try: import gpgme @@ -47,9 +48,14 @@ from posixpath import curdir, sep, pardir, join, abspath, commonprefix INFO = u"Dropbox is the easiest way to share and store your files online. Want to learn more? Head to" -LINK = u"http://www.dropbox.com/" +LINK = u"https://www.dropbox.com/" WARNING = u"In order to use Dropbox, you must download the proprietary daemon." GPG_WARNING = u"Note: python-gpgme is not installed, we will not be able to verify binary signatures." +ERROR_CONNECTING = u"Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable." +ERROR_SIGNATURE = u"Downloaded binary does not match Dropbox signature, aborting install." + +DOWNLOAD_LOCATION_FMT = "https://www.dropbox.com/download?plat=%s" +SIGNATURE_LOCATION_FMT = "https://www.dropbox.com/download?plat=%s&signature=1" DOWNLOADING = u"Downloading Dropbox... %d%%" UNPACKING = u"Unpacking Dropbox... %d%%" @@ -60,7 +66,7 @@ enc = locale.getpreferredencoding() -# Available from http://linux.dropbox.com/fedora/rpm-public-key.asc +# Available from https://linux.dropbox.com/fedora/rpm-public-key.asc DROPBOX_PUBLIC_KEY = """ -----BEGIN PGP PUBLIC KEY BLOCK----- Version: SKS 1.1.0 @@ -196,76 +202,58 @@ del os.environ['GNUPGHOME'] shutil.rmtree(_gpghome, ignore_errors=True) +class SignatureVerifyError(Exception): + pass + def verify_signature(key_file, sig_file, plain_file): with gpgme_context([key_file]) as ctx: sigs = ctx.verify(sig_file, plain_file, None) return sigs[0].status == None -def download_file_chunk(socket, buf, size): +def download_file_chunk(url, buf): + opener = urllib2.build_opener() + opener.addheaders = [('User-Agent', "DropboxLinuxDownloader/@PACKAGE_VERSION@")] + sock = opener.open(url) + + size = int(sock.info()['content-length']) + bufsize = max(size / 200, 4096) progress = 0 - with closing(socket) as f: + + with closing(sock) as f: + yield (0, True) while True: try: - chunk = os.read(f.fileno(), 4096) + chunk = f.read(bufsize) progress += len(chunk) buf.write(chunk) - yield (progress, True) + yield (float(progress)/size, True) if progress == size: break except OSError, e: if hasattr(e, 'errno') and e.errno == errno.EAGAIN: # nothing left to read - yield (progress, False) + yield (float(progress)/size, False) else: raise -def download_uri_to_buffer(uri): - try: - socket = urllib.urlopen(uri) - except IOError: - FatalVisibleError("Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable.") - - fcntl.fcntl(socket, fcntl.F_SETFL, os.O_NONBLOCK) - size = int(socket.info()['content-length']) - - buf = StringIO.StringIO() - download_chunk = download_file_chunk(socket, buf, size) - - for _ in download_chunk: - pass - - buf.seek(0) - return buf - -# This sets a custom User-Agent -class DropboxURLopener(urllib.FancyURLopener): - version = "DropboxLinuxDownloader/@PACKAGE_VERSION@" -urllib._urlopener = DropboxURLopener() - class DownloadState(object): def __init__(self): - try: - self.socket = urllib.urlopen("http://www.dropbox.com/download?plat=%s" % plat()) - except IOError: - FatalVisibleError("Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable") - - fcntl.fcntl(self.socket, fcntl.F_SETFL, os.O_NONBLOCK) - self.size = int(self.socket.info()['content-length']) - self.local_file = StringIO.StringIO() - self.download_chunk = download_file_chunk(self.socket, self.local_file, self.size) def copy_data(self): - return self.download_chunk + return download_file_chunk(DOWNLOAD_LOCATION_FMT % plat(), self.local_file) def unpack(self): # download signature - signature = download_uri_to_buffer("http://www.dropbox.com/download?plat=%s&signature=1" % plat()) - + signature = StringIO.StringIO() + for _ in download_file_chunk(SIGNATURE_LOCATION_FMT % plat(), signature): + pass + signature.seek(0) self.local_file.seek(0) + if gpgme: if not verify_signature(StringIO.StringIO(DROPBOX_PUBLIC_KEY), signature, self.local_file): - FatalVisibleError("Downloaded binary does not match Dropbox signature, aborting install.") + raise SignatureVerifyError() self.local_file.seek(0) archive = tarfile.open(fileobj=self.local_file, mode='r:gz') @@ -296,6 +284,8 @@ import pango import webbrowser + gtk.gdk.threads_init() + load_serialized_images() global FatalVisibleError @@ -310,9 +300,40 @@ gtk.main_quit() sys.exit(-1) - def gtk_flush_events(): - while gtk.events_pending(): - gtk.main_iteration() + class GeneratorTask(object): + def __init__(self, generator, loop_callback, on_done=None, on_exception=None): + self.generator = generator + self.loop_callback = loop_callback + self.on_done = on_done + self.on_exception = on_exception + + def _run(self, *args, **kwargs): + self._stopped = False + try: + for ret in self.generator(*args, **kwargs): + if ret is None: + ret = () + if not isinstance(ret, tuple): + ret = (ret,) + gobject.idle_add(self.loop_callback, *ret) + + if self._stopped: + thread.exit() + except Exception, ex: + print ex + if self.on_exception is not None: + gobject.idle_add(self.on_exception, ex) + else: + if self.on_done is not None: + gobject.idle_add(self.on_done) + + def start(self, *args, **kwargs): + t = threading.Thread(target=self._run, args=args, kwargs=kwargs) + t.setDaemon(True) + t.start() + + def stop(self): + self._stopped = True class DownloadDialog(gtk.Dialog): def handle_delete_event(self, wid, ev, data=None): @@ -322,8 +343,8 @@ reroll_autostart(not button.get_active()) def handle_cancel(self, button): - if self.watch: - gobject.source_remove(self.watch) + if self.task: + self.task.stop() if self.download: self.download.cancel() gtk.main_quit() @@ -333,51 +354,51 @@ # begin download self.ok.hide() self.download = DownloadState() - self.one_chunk = self.download.copy_data() - self.watch = gobject.io_add_watch(self.download.socket, - gobject.IO_IN | - gobject.IO_PRI | - gobject.IO_ERR | - gobject.IO_HUP, - self.handle_data_waiting) + self.label.hide() - self.dont_show_again_align.hide() + if self.dont_show_again_align is not None: + self.dont_show_again_align.hide() self.progress.show() - def update_progress(self, text, fraction): - self.progress.set_text(text % int(fraction*100)) - self.progress.set_fraction(fraction) - gtk_flush_events() + def download_progress(progress, status): + if not status: + self.task.stop() + self.update_progress(DOWNLOADING, progress) - def handle_data_waiting(self, fd, condition): - if condition == gobject.IO_HUP: - FatalVisibleError("Connection to server unexpectedly closed.") - elif condition == gobject.IO_ERR: - FatalVisibleError("Unexpected error occurred with download.") - try: - while True: - progress, status = self.one_chunk.next() - if not status: - break - self.update_progress(DOWNLOADING, float(progress)/self.download.size) - except StopIteration: + def finished(): self.update_progress(DOWNLOADING, 1.0) self.unpack_dropbox() - return False - else: - self.update_progress(DOWNLOADING, float(progress)/self.download.size) - return True + + def error(ex): + FatalVisibleError(ERROR_CONNECTING) + + self.update_progress(DOWNLOADING, 0) + self.task = GeneratorTask(self.download.copy_data, + download_progress, + finished, error).start() + + def update_progress(self, text, fraction): + self.progress.set_text(text % int(fraction*100)) + self.progress.set_fraction(fraction) def unpack_dropbox(self): - one_member = self.download.unpack() - try: - while True: - name, i, total = one_member.next() - self.update_progress(UNPACKING, float(i)/total) - except StopIteration: + def unpack_progress(name, i, total): + self.update_progress(UNPACKING, float(i)/total) + + def finished(): self.update_progress(UNPACKING, 1.0) gtk.main_quit() + def error(ex): + if isinstance(ex, SignatureVerifyError): + FatalVisibleError(ERROR_SIGNATURE) + else: + FatalVisibleError(ERROR_CONNECTING) + + self.task = GeneratorTask(self.download.unpack, + unpack_progress, + finished, error).start() + def mouse_down(self, widget, event): if self.hovering: self.clicked_link = True @@ -406,7 +427,6 @@ title = "Dropbox Installation") self.download = None - self.watch = None self.hovering = False self.clicked_link = False self.user_cancelled = False @@ -458,6 +478,8 @@ self.vbox.add(self.hbox) + self.dont_show_again_align = None + try: if can_reroll_autostart(): dont_show_again = gtk.CheckButton("_Don't show this again") @@ -477,7 +499,6 @@ self.set_resizable(False) except: - import traceback traceback.print_exc() self.ok.grab_focus() @@ -526,24 +547,27 @@ return download = DownloadState() - one_chunk = download.copy_data() try: - while True: - progress = one_chunk.next()[0] - setprogress(DOWNLOADING, float(progress)/download.size) - except StopIteration: + for progress, status in download.copy_data(): + if not status: + break + setprogress(DOWNLOADING, progress) + except Exception: + FatalVisibleError(ERROR_CONNECTING) + else: setprogress(DOWNLOADING, 1.0) console_print() write(save) - one_member = download.unpack() - try: - while True: - name, i, total = one_member.next() + for name, i, total in download.unpack(): setprogress(UNPACKING, float(i)/total) - except StopIteration: + except SignatureVerifyError: + FatalVisibleError(ERROR_SIGNATURE) + except Exception: + FatalVisibleError(ERROR_CONNECTING) + else: setprogress(UNPACKING, 1.0) console_print() @@ -788,9 +812,8 @@ original_texts = texts[:] for col in range(len(texts)): texts[col] = texts[col].ljust(colwidths[col]) - line = u"%s" % " ".join(texts) - for i, text in enumerate(original_texts): - line = line.replace(text, display_texts[i]) + texts[col] = texts[col].replace(original_texts[col], display_texts[col]) + line = u" ".join(texts) lines.append(line) for line in lines: console_print(line) @@ -932,6 +955,10 @@ else: if len(args) == 0: args = [name for name in sorted(os.listdir(u"."), key=methodcaller('lower')) if type(name) == unicode] + if len(args) == 0: + # Bail early if there's nothing to list to avoid crashing on indent below + console_print(u"") + return indent = max(len(st)+1 for st in args) for file in args: @@ -1228,7 +1255,7 @@ try: download() except: - pass + traceback.print_exc() else: if GUI_AVAILABLE: start_dropbox() diff -Nru nautilus-dropbox-0.7.1/dropbox.txt.in nautilus-dropbox-1.6.1/dropbox.txt.in --- nautilus-dropbox-0.7.1/dropbox.txt.in 2011-10-20 02:27:53.000000000 +0000 +++ nautilus-dropbox-1.6.1/dropbox.txt.in 2013-01-23 22:20:59.000000000 +0000 @@ -39,8 +39,8 @@ RESOURCES ========= -* Dropbox -* Dropbox Forums +* Dropbox +* Dropbox Forums * Dropbox Support E-mail AUTHORS diff -Nru nautilus-dropbox-0.7.1/README nautilus-dropbox-1.6.1/README --- nautilus-dropbox-0.7.1/README 2010-06-14 23:36:52.000000000 +0000 +++ nautilus-dropbox-1.6.1/README 2013-01-23 22:20:59.000000000 +0000 @@ -5,7 +5,7 @@ Now you can use your favorite sync, versioning, and backup software with GNU/Linux! Yes!! Radical!!! Gnarly!!!! -Check us out at http://www.dropbox.com/ +Check us out at https://www.dropbox.com/ <3, Rian Hunter and the rest of the Dropbox Team