Page 1 of 1

Google Chrome Updater

Posted: 6. Feb 2012, 21:26
by pwatk
For anyone who prefers Google Chrome over the other web browsers on offer I've made a package that creates a cron job to automatically check for updates on a daily basis.

If an update is available then the Debian package is fetched from dl.google.com along with the google-chrome.Slackbuild from the Slackware repository and a package is created. From there it is added to a local repository (using metagen.sh) for installation via slapt-get.

Here's the contents of the README.Slackware:

Code: Select all

Google Chrome auto-updater
==========================

This package creates a cron job to automatically check for updated versions of the Google Chrome web browser on a daily basis.

To enable the cron job change the 'ENABLED' variable to '1' in the config file /etc/default/google-chrome-update .
  
  ENABLED="1"

When a new version is detected it is downloaded, packaged and then added to a local repositiory for installation via slapt-get.

You can alter the location of the local repository by changing the 'REPO' variable the config file /etc/default/google-chrome-update .

  REPO="/var/www/packages"

To add the local repository to slapt-get you need to append a new 'SOURCE' line to /etc/slapt-get/slapt-getrc.

  SOURCE=file:///var/www/packages/:CUSTOM

All notifications and warnings are logged via syslog and output to the terminal if /etc/cron.daily/google-chrome-update is
launched from the command line.

If you use this cron job on a system that isn't running 24/7 (e.g. a laptop) you may want to alter the root user's crontab
(/var/spool/cron/crontabs/root) to use timestamps instead of fixed times to ensure any missed jobs are run.

  @daily ID=cron-daily /usr/bin/run-parts /etc/cron.daily 1> /dev/null

A complete crontab sample using timestamps for all cron jobs is distributed with this REAME.
You can download the package from here:
http://people.salixos.org/pwatk/package ... me-update/

All the commands used in the script should be present on a basic installation but please check the README (or .dep file) provided just encase.

Acknowledgement goes to ruario for code I reused to extract the version from the Packages.gz file:
http://www.linuxquestions.org/questions ... te-887131/

As of version 0.4 the 'OUTPUT' directory is cleared every time a new update is made available so don't use it for anything else. The default location for this directory is /var/www/packages/salix/google-chrome.

Re: Google Chrome Updater

Posted: 24. Feb 2012, 12:19
by thenktor
Hi pwatk,

I've installed this on my server and I have a feature request: it would be nice if it could create 32 and 64 bit packages in 2 seperate repositories.
I did not check your source but I guess the script is doing this:
* it checks if a newer version is available
* downloads the new version
* creates the packages
* deletes old packages
* updates the repo
Is this right?

Re: Google Chrome Updater

Posted: 24. Feb 2012, 22:21
by pwatk
It doesn't delete the old package (although I might add this) and unless you create a gpg key the repository isn't signed and it doesn't create a changelog either.

I made this primaily for individual systems rather than servers but I can add an option to support building for both architectures if you like. I'll try to do it sometime next week.

Re: Google Chrome Updater

Posted: 29. Feb 2012, 20:53
by pwatk
I started writing a new version but then I realised that you need Google Chrome installed to check the current version. I can still upload it with the option to build both architectures but it's not really suitable for updating packages on a server.

Re: Google Chrome Updater

Posted: 11. Apr 2012, 10:48
by ruario
pwatk wrote:Acknowledgement goes to ruario for code I reused to extract the version from the Packages.gz file.
I knew I shouldn't have posted that! I hate helping the competition! :P

Oh and nice updater by the way! :D

P.S. I discuss other ways of working out the version number in a post on my blog.

Whilst I will always prefer Opera I do like to keep all of the major browsers up to date on my system as it allows comparative testing. So I actually have a couple of scripts that can will check for the latest version and download myself. Here is one for Chrome and one for Firefox.

For Opera I have opupdate, which can track Stable, Beta or development snapshots of Opera Next and automatically repackage them into Slackware/Salix format. Alternatively for people who prefer SlackBuild-style scripts I have those as well. And I host binary versions for those who prefer them.