Dropbox Forums » Everything Else

dbupdate v0.2.9 - Dropbox experimental build automatic update script for Linux.

(85 posts)
  • Started 5 months ago by Dusten B.
  • Latest reply from Olivier G.


RSS feed for this topic


  1. Dusten B.
    Member
    Posts: 168

    This script can automatically download and install the latest experimental build of Dropbox, if the latest version is newer than your current version.

    Download the script:
    -Shell source:
    http://dl.getdropbox.com/u/1108539/dbupdate/dbupdate0.2.9 (core script)

    -Debian/Ubuntu (deb) packages:
    http://dl.getdropbox.com/u/1108539/dbupdate/dbupdate-0.2.5.deb (integration, optional)
    http://dl.getdropbox.com/u/1108539/dbupdate/dbupdate-bin-0.2.9.deb (core script)

    -Fedora/Red-Hat (rpm) package:
    http://dl.getdropbox.com/u/1108539/dbupdate/dbupdate-bin-0.2.9-1.noarch.rpm (core script)

    Or on Debian/Ubuntu, you can add this repo to your sources.list:
    deb http://dl.dropbox.com/u/1108539/dbupdate ./ #dbupdate
    Then run sudo apt-get update && sudo apt-get install dbupdate to install.

    dbupdate depends on dbupdate-bin, (the script) libnotify-bin, (the notifier) and zenity, (GUI info) and adds an autostart entry. This entry defaults to upgrade the Dropbox client. Edit the dbupdate autostart entry to change the delay or otherwise alter the default behaviour at login.
    dbupdate-bin is the package containing the actual script. Depends on bash.

    If script downloaded as source, you can run this script from wherever, but if you find it useful I would recommend using it's built-in "installer", which sets itself up in /usr/share/dbupdate and creates a symlink to /usr/bin/dbupdate to make it easier to use. If you wish to install, use: sudo bash ./dbupdate0.2.9 -i0 from the same directory as the script, afterwhich the script can be called using dbupdate from anywhere. Installing this script in this manner is not required for it to function.

    Usage is pretty straight forward, use dbupdate -h or see man dbupdate

    (old) Video showing script working at http://www.youtube.com/watch?v=dwJNDHsNNSA for those who are interested.
    Changelog is available at http://dl.dropbox.com/u/1108539/dbupdate/changelog for those who are interested.
    GNU-LGPL license is available at http://dl.dropbox.com/u/1108539/dbupdate/LICENSE

    Feel free to contribute to this code on your own, but please post or link your updates so I can include them in this post.

    Comments, suggestions, bug reports, and polite criticisms are welcome.

    Posted 5 months ago #
  2. Dusten B.
    Member
    Posts: 168

    Updated and added a proof video.

    Posted 5 months ago #
  3.  Seth B.
    Pro User
    Posts: 43

    Dusten,

    Nice scripting; a couple of things you might want to consider since this will be run as root (I may be overly paranoid here):

    1) avoid /tmp due to the possibility of race conditions / symlink exploits, or add some more robust checking for your mkdir.
    2) set $PATH at the beginning or fully-path your "dropbox" calls (since sudo preserves the user's path, an attacker *might* be able to get root to execute something arbitrary)

    Posted 5 months ago #
  4. Dusten B.
    Member
    Posts: 168

    I appreciate the comments.

    1) I am only using /tmp to temporarily store the updated dropbox tarball. It it unpacked to a separate location. It only needs access to it for roughly 1 second on my machine, after-which it can safely be removed by the user during housekeeping. Dropbox, to my knowledge, does not use /tmp, which regardless, my script stores the upgrade package within it's own subdirectory of /tmp. As well, the wget defaults to creating *.1, *.2, &c.. files if it detects the existence of a file of the same name. I don't see the possibility of a race condition to exist here, but should one occur, I can lock the file. I'm attempting to go along with *nix pseudo-standards by using /tmp.

    2) All calls are now use absolute paths.

    A note, though, the script does not require su/sudo to function, only if you wish to install the script to /usr/share and /usr/bin. As a matter of fact, I would recommend against going su during day-to-day use.

    A solution to this I have implemented, though I do not like. It is late, so I will come up with something more creative later. I check for root when invoking the script. Only non-root can use the script, and only root can use it to install itself. This is very ungraceful to me, as those few users who are stuck on logging in as root (and those who must, such as admins) cannot use it. I'll figure something out.

    I did update the script, with many little fixes. Thank you, Seth.

    Posted 5 months ago #
  5. Dusten B.
    Member
    Posts: 168

    Updated again.

    Re-enabled root use.
    Added notification on your DE if libnotify-bin is present.
    Made GNU-LGPL.
    Various other minor little things.

    I'm content and losing interest now, so this will likely be my last update. Script functions as advertised. Thanks to the Dropbox developers for keeping their version info file updated, which allows this to work.

    If you find any issues, feel free to let me know and I will fix them, or you can post a patch and I will incorporate it.

    Posted 5 months ago #
  6. Herbert S.
    Member
    Posts: 1

    There is a small problem when using --install-dbupdate as it assumes the script to be in the current directory when applying $0 for the chmod and ln commands - contrary to what the usage message says. Better substitute $(basename $0) in these two lines...

    Very useful script indeed!

    Posted 4 months ago #
  7. Dusten B.
    Member
    Posts: 168

    Thank you very much, @Herbert S., for pointing out to me my apparent oversight, and for providing a simple fix as well. I have implemented the fix, along with a bit of added error checking, and credit to yourself. The top post now reflects the updated version.

    Posted 4 months ago #
  8. Dusten B.
    Member
    Posts: 168

    Ok, I got bored and decided to work on packaging, and packaged this for Debian. I know it doesn't need to be packaged, but I did it anyway... because I can. :) .deb can be found in top post.

    I've looked at making .rpm packages, but the rpm format is goofy to me, so we'll see if I ever actually get around to doing it or not.

    Posted 4 months ago #
  9.  Tomaz M.
    Pro User
    Posts: 28

    If you don't want to or don't have the time to create .rpm package manually you could use tool named alien which knows how to convert .deb package to .rpm and vice-versa :)

    Posted 4 months ago #
  10. Dusten B.
    Member
    Posts: 168

    Thanks for reminding me about alien, @Tomaz. I posted a rpm package in the top post, which is untested.

    I also made a repo out of my Dropbox. Was this needed? Absolutely not, but I get bored sometimes.

    Posted 4 months ago #
  11. Dusten B.
    Member
    Posts: 168

    I added a --delay option to function better as an autostart during session login, and altered notifications.
    --delay must be last option.

    Posted 4 months ago #
  12. Dusten B.
    Member
    Posts: 168

    Major update; complete rewrite.
    Added various things, and fixed various potential bugs.
    Top post and repository updated.

    Noteworthy changes:
    Changed command line options to be POSIX compliant, rather than using the GNU long options.
    GUI download progress indicator option
    Force upgrade to certain version
    Can be used to install dropbox for first time, or to fix broken installs.
    Automatically detects for 64bit Dropbox by default now.

    Please let me know of any new bugs, suggestions, or comments.

    Posted 4 months ago #
  13. Luke S.
    Member
    Posts: 3

    Hmm, doesn't seem to work for a fresh install.

    Fedora 11 test box.

    I get

    [root@n0rty ~]# dbupdate -cb 32
    Will use 32 bit Dropbox.
    Checking currently installed version...FAIL!
    Dropbox version not detected. Aborting.

    Posted 4 months ago #
  14. Dusten B.
    Member
    Posts: 168

    @Luke: Without Dropbox already installed, try the force flag;
    dbupdate -b 32 -f 0.7.28
    should download and unpack the 32bit version of dropbox 0.7.28. It will probably fail at the end when it tries to restart dropbox (since it hasn't invoked dropbox -i yet) But you can finish manually from there.

    I'll work on having it perform fresh installs properly in the next couple of days, and work on the help screen or add a man page (for the rpm and deb package of script)

    Posted 4 months ago #
  15. Dusten B.
    Member
    Posts: 168

    Updated.
    .rpm package now at newest version.
    Fixed some bevaviour issues.
    Fixed dependencies in .deb/.rpm packages.
    Fixed autostart entry in dbupdate .deb/.rpm packages.

    Posted 4 months ago #
  16. Darren S.
    Member
    Posts: 335

    Hi,

    I just downloaded this script and will check it out thanks.

    A couple of things:
    1. There is a typo in the dialogue box that comes up during install. It disappeared before I could get a screen grab but on the second to last line it says "ungrading" when I think it should say "upgrading".

    2. I experienced a crash right after install. This is what came up in my terminal (installed using apt-get from the PPA):

    Unpacking dbupdate (from .../dbupdate_0.2.1_i386.deb) ...
    Setting up dbupdate (0.2.1) ...
    dpkg: error processing dbupdate (--configure):
    subprocess post-installation script returned error exit status 5
    Errors were encountered while processing:
    dbupdate
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    But there's nothing of any help in either /var/log/syslog or /var/log/dpkg.log. Apport did try to create a crash report but then gave up because it's not an official Ubuntu package. Not sure where else to look but let me if you there's any more information I can give. I am using Ubuntu 9.04. Despite all this the script does seem to be working OK (although I'll have to wait for a new release before I can fully test it).

    Posted 4 months ago #
  17. Dusten B.
    Member
    Posts: 168

    1. I fixed the typo in the dialog, and also let it remain for about 45 seconds before it kills itself. It was 20 before.

    2. I've made some changes to the dbupdate package. Testing it here gives an error free install. This is imported to the repo so you should get it the next time you apt-get upgrade. You could reinstall the dbupdate package by itself - it shouldn't return an error this time around.
    sudo apt-get remove dbupdate && sudo apt-get update && sudo apt-get install dbupdate

    The method I have been using lately to test the scripts functionality when no real Dropbox upgrade is available is to use the script to force an older version dbupdate -gf 0.7.24 then using various other options, such as dbupdate -gnu. Previous to the 0.2.x version of this script, I would alter ~/.drfopbox-dist/VERSION to falsley reflect an older version.

    Thank you for pointing this issues out to me.

    Posted 4 months ago #
  18. Luke S.
    Member
    Posts: 3

    Hi Dustin,

    ok on a fresh/vanilla install of Fedora, I get the following;

    ./dbupdate0.2.2 -b 32 -f 0.7.28
    Will use 32 bit Dropbox.
    Downloading update. This may take a few minutes.../tmp/dbupdate/dropbox-lnx.x86-0.7.28.tar.gz: No such file or directory
    Error 0 returned.
    Aborting.

    Posted 4 months ago #
  19. Dusten B.
    Member
    Posts: 168

    Thank you Luke. I found the issue and corrected it. It should function properly now.

    And also, as always, I made a few other not-noteworthy changes. The script is available in the top post, and I'll update the packages and repository later today.

    Posted 4 months ago #
  20. Luke S.
    Member
    Posts: 3

    Hi Dustin,

    Some more feedback. Still errors out on the fresh machine;

    ./dbupdate0.2.3 -b 32 -f 0.7.28
    Will use 32 bit Dropbox.
    Looking for temporary space...Created.
    Downloading update. This may take a few minutes... Done.
    Installing Dropbox 0.7.28... Done.
    ./dbupdate0.2.3: line 254: /usr/bin/dropbox: No such file or directory
    Error 0 returned.
    Aborting.

    Posted 4 months ago #
  21. Dusten B.
    Member
    Posts: 168

    Ok Luke, I've made a couple little changes and tested it the best I could on my system. If you could try this (v0.2.4 in top post) and see how it goes for you?

    Something I did notice was the frequent failure of dropbox to begin its install process. This is a known issue with Dropbox on Linux platforms, so if the dropbox installer does not begin for you after dbupdate fetches it, keep repeatedly trying to start it yourself. I've had the best success (when it didn't start when called from the script) by running:
    ~/.dropbox-dist/dropbox start -i
    and if (when) it fails to start:
    pkill dropbox*
    and repeating. It may take a moment (or a second call to pkill) for the hanging dropbox instance to kill. Eventually it will start. It has taken me upwards of 6 or 7 tries before it started during testing on my system.

    If the dropbox installer fails to start when called by the script, the script may appear to hang, not dropping you to prompt. This, again, has something to do with Dropbox. Just hit ENTER and you'll see your prompt. I believe this issue has something to do with Dropbox and is beyond script-work.

    I hope it works this time for you :) If not, please, let me know. I'd be glad to keep working on it, and would welcome anybody else's assistance.

    Posted 4 months ago #
  22. Mélanie T.
    Member
    Posts: 23

    Wow, really cool this thing!
    Just a little notice. I tried (integration, optional) Ubuntu package but it didn't install (missing a dependancy). However, the script version is working fine. I think I will try to get some cron weekly verification, if I'm able to do it! (I'm quite new to linux...)
    Thanks
    Mel

    Posted 4 months ago #
  23. Dusten B.
    Member
    Posts: 168

    @Melanie T: The dbupdate deb package depends on the dbupdate-bin package, as well as zenity, and libnotify-bin. The package installer will download whatever it depends on that it can find in the repos automatically. Without adding my repo, the dbupdate-bin won't be located and it won't let you install.

    If that didn't confuse you, great! If it did, it doesn't matter. :) To install via packages:
    Install the dbupdate-bin package first, _then_ install the dbupdate package.

    Posted 4 months ago #
  24.  Erik F.
    Pro User
    Posts: 16

    Hi there guys,

    is there something broken with the dbupdate script? I'm using dbupdate0.2.4 and obviously currently 0.7.45 of DropBox is the latest one. I have DB 0.7.44 installed, but dbupdate tells me "0.7.44 is latest version. Update not required." :-(

    Thanks in advance for any hint!

    Cheers, Erik

    Posted 3 months ago #
  25. Christopher F.
    Member
    Posts: 11

    same thing with my dbupdate script!

    using 0.7.44 and it says that's the latest!

    nice greez

    Posted 3 months ago #
  26. Dusten B.
    Member
    Posts: 168

    Sorry guys! At the moment, the script relies on some action by the Dropbox developers to keep a file on their end current with the latest version information. If the latest version is 0.7.45, but they haven't updated the file on their end (called "experimental.txt") since version 0.7.44, the script cannot detect the available update.

    I have had to remind them a couple of times to update experimental.txt, and thankfully I have noticed a couple of other apparent users of the script do the same. The devs have been doing better as of late :) When I checked this thread, I checked my installed version of Dropbox to discover that it had been updated already to 0.7.45 by the dbupdate script.

    I would like to thank the Dropbox developers again for their efforts in keeping the file as current as they have. I appreciate it guys.

    I have also recently had a couple of other ideas to remedy this situation if the devs don't implement some type of automation. Expect a script update to be available in the next week or two. I will be devoting a bit of time again to this script as time becomes available to me.

    Good news is, though, that it works now. :) I apologise for the delay.

    edit: except that NOW the current version is 0.7.48 and the script isn't picking up. Sorry :) I'm sure they'll get to it in short time, though.

    Posted 3 months ago #
  27.  Erik F.
    Pro User
    Posts: 16

    Hi Dusten, thanks for the info and all the time you spent. I'm not too familiar with the script - just ran in it the past and it worked just fine - but isn't the "-f" option a possible workaround to overcome the problem until there's an automated solution for it?

    IIRC I can pass a dedicated version number using -f - and if I see in my RSS feed for the beta / experimantal build, that a new version is discussed and my dbupdate script doesn't recognize it, then I'd use the -f option and force it to be downloaded manually. Or is the -f option meant for something different (I'd never used it so far :-) ).

    Cheers, Erik

    Posted 3 months ago #
  28. Dusten B.
    Member
    Posts: 168

    Erik, yes, you can use the "-f" option if you know the version number you want to upgrade to, just as you suspected. dbupdate -f 0.7.48 will force the installation of v0.7.48.

    I had originally added the "-f" flag for testing, so I could force it to an older version so that I could test various parts of the updater, detection, and progress indicator ("-g"). I realised how the flag could be useful to others to easily downgrade to an older experimental build should one of the newer builds have unexpected and unwanted behaviour, amongst other uses, such as this.

    Posted 3 months ago #
  29. Olivier G.
    Member
    Posts: 16

    It seems that the deb repository don’t work.
    And the .deb are not for x86_64 :( Can you think about using launchpad or something like that, if I well understand, .deb creation for various platform is automatic !

    Thank’s for your work indead,
    Olivier.

    Posted 3 months ago #
  30. Dusten B.
    Member
    Posts: 168

    Launchpad isn't for packaging, it is for compiling. dbupdate is simply a bash script, and can't be compiled. If I were to port the script to C, then I could have Launchpad compile and package it for various platforms. As simple as it is, I honestly have little interest in doing this.

    Since this is a script, there is no need for 64bit version; if bash is 64bit, then the script will be run 64bit. If the .deb will, for some reason, not install, just use the shell script, and run it from that, and let me know what specific issues you are encountering so I can attempt to get them sorted.

    Here is a video I just made, showing how the repo seems to be working just fine for me.
    http://www.youtube.com/watch?v=JHhvUJLgJxI
    Be sure the ./ is listed after the server location in the deb line of your /etc/apt/sources.list.

    If you do have any problems, let me know!

    Posted 3 months ago #

Reply »

You must log in to post.

Dropbox Forums is proudly powered by bbPress.

Protected by Arash