A poor man's auto-update with snapshot support
Monday, January 10, 2011 8:18:34 AM
And now some background to where this comes from. I have had numerous related scripts for a while, all doing slightly different things. For example, one that selected a build from our internal build archive based on supplying architecture, version number and build number, another that auto-downloaded the latest snapshot (which auto detected the architecture), yet another that checked the build number for last stable (but did not download), and so on. The reason they were all separate and worked slightly differently is because I wrote them at different times based on different needs.
Most of these various scripts had no error checking and printed out very little feedback as they were only to be used by me. This weekend it occurred to me that I should take some of the best bits of several of these and add in some error checking and feedback. It simplifies things to have just one script and means that I could share it with colleagues if I wanted to.
After relatively little effort I got something that seems to work. It is not the prettiest script because I am not particularly skilled in this area (I know enough to get by, for basic stuff). There is also the fact that it is a hack job of several different things. Hence the variable names are a little odd and sometimes my methods for doing things seem a little strange. For example, I sometimes use external tools when bash could have done the job itself (because not all of the parent scripts use bash). I have cleaned it up a little but only really enough so that it is understandable to me.
Once I was done I realised I had something that several users have asked for, a way to easily check for and auto-update snapshots and hence it is hard for me to resist sharing it. So I will but first a couple more disclaimers. This may not work for you. Any use it at your own risk. After a limited amount of testing on my home machine it seems to work pretty well but don't blame me if it causes you problems.
If you do want to try my script, you can grab it here. Just save it somewhere in your $PATH and make it executable. Alternatively install opupdate_0.9.9-1_all.deb or opupdate-0.9.9-1.noarch.rpm. Slackware users can install op2slk-0.9.13-noarch-1ro.tgz, which has a copy of opupdate bundled within it. The Slackware version will even offer to convert to Slackware native package format first, prior to install.
To use, just type opupdate in a terminal window and answer the questions. You can probably just hit enter to accept the defaults (I have tried to design it with sensible ones!). Alternatively, here is an opupdate button that Zotlan provided for maximum convenience (no need to use the terminal)! To use the button, install it by clicking the link. You can then drag it anywhere in Opera's interface, except the bookmarks bar.
Finally, if someone wants to make a better version or already has something similar, please share it below. Who knows I might switch to yours myself!
P.S. Just subscribe the Desktop Team Blog's RSS feed to be notified of new builds in the browser itself!