LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-03-2012, 08:45 AM   #16
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,856

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873

It just occurred to me that you don't need to download the whole deb just to check the version, instead you could use the information from Google's repository and then only download if the version they are serving is different from the one installed.

Code:
#!/bin/sh

if [ -x /usr/bin/google-chrome ]; then
  CURVERSION=$(google-chrome --version | awk '{print$3}')
  echo "Google Chrome $CURVERSION is installed."
else
  CURVERSION=UNKNOWN
  echo "Could not detect an installed version of Google Chrome"
fi

case "$(uname -m)" in
  i?86) DEBARCH="i386";;
  x86_64) DEBARCH="amd64";;
  *) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
esac

if ! curl -fs https://dl.google.com/linux/chrome/deb/dists/stable/main/binary-${DEBARCH}/Packages.gz -o /tmp/google-packages-list.gz; then
  echo "Could not connect to the Google repository to check the latest version"
  exit 1
fi

NEWVERSION=$(zcat /tmp/google-packages-list.gz | awk -F "[ -]" '/Package: google-chrome-stable/{getline;print$2}')

if [ "${CURVERSION}" = "${NEWVERSION}" ]; then
  echo "You appear to have the latest version of Google Chrome already."
else
  echo "Downloading Google Chrome ${NEWVERSION}."
  curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_${DEBARCH}.deb
fi

Last edited by ruario; 01-04-2012 at 04:12 AM. Reason: Simplified the way NEWVERSION is extracted
 
6 members found this post helpful.
Old 01-05-2012, 12:37 PM   #17
dwblas
Member
 
Registered: Jun 2011
Posts: 54

Rep: Reputation: Disabled
Hasn't anyone tried rpm2txz. It's 3 steps
download
rpm2txz
upgradepkg
 
Old 01-05-2012, 01:35 PM   #18
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,856

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
That doesn't solve the problem of you knowing if you are on the latest version. The about page in Chrome itself only tells you what version you are running. It does not tell you if there is a new one. The download page doesn't tell you the version number of the current stable either.

This actually pissed me off enough I wrote a little rant about it on my blog:
http://my.opera.com/ruario/blog/2012...ersion-numbers

Last edited by ruario; 01-05-2012 at 01:37 PM. Reason: added link to blog
 
Old 03-29-2012, 04:01 AM   #19
anGeR
Member
 
Registered: Oct 2003
Distribution: Slackware 13.37
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by neymac View Post
Thank you, blue_k.
As sugestion, instead of "./google-chrome.SlackBuild" line, you can replace it (copy and paste) with the body of google-chrome.SlackBuild script.
And you don't need the google-chrome.SlackBuild script in your Downloads folder anymore.

[CODE]
#!/bin/bash
cd /tmp
wget --no-check-certificate https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

#here starts the google-chrome slackbuild script

/cut
I would like to thank you for this script it's excellent.
Although I would remove two last lines in case someone has old "5x, 6x" packages because after installing current (18x) version, updatepkg tried to update it and used old ones so install crashed. After removing last two lines (updatepkg), everything went ok.
 
Old 08-22-2012, 02:44 PM   #20
Col-Panic
LQ Newbie
 
Registered: Feb 2007
Location: Blue Mountains of NE Oregon, out on the Rez
Distribution: Slackware, Slackware64, Slamd64, Gentoo, RedHat
Posts: 13

Rep: Reputation: 1
Quote:
Originally Posted by ruario View Post
It just occurred to me that you don't need to download the whole deb just to check the version, instead you could use the information from Google's repository and then only download if the version they are serving is different from the one installed.
Slick! Very tidy way of accomplishing this task. Thank you!
 
Old 08-22-2012, 02:54 PM   #21
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,856

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
@Col-Panic: you might like this updated method even better:

http://www.panix.com/~ruari/latest-chrome
 
Old 08-23-2012, 08:02 AM   #22
schultzter
Member
 
Registered: Sep 2009
Distribution: Arch Linux
Posts: 40

Rep: Reputation: 3
That's pretty cool ruario!

The only thing I would suggest is making stable/beta/... a variable. I prefer the beta version of Chrome (living on the edge!) so I would change all the "stable" strings to ${RELEASE} and set it early in the script to "stable" if it isn't already set (from the command line). This is how the official SlackBuild script works.

Thanks,
 
Old 06-02-2013, 03:23 PM   #23
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,856

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
@schultzter: I have a better idea!
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 19 vulnerabilities - Chrome 9 update proves expensive for Google LXer Syndicated Linux News 0 03-01-2011 04:30 PM
Google Chrome New Tab Page (!)= Chrome OS Desktop Kenny_Strawn Linux - General 6 02-19-2011 05:36 PM
[SOLVED] Last update broke google chrome spoovy Slackware 3 12-23-2010 12:00 PM
LXer: As Goes Chrome OS, So Goes Google's Chrome Browser LXer Syndicated Linux News 4 10-09-2010 03:18 PM
LXer: Google Chrome Automatically Installs Google Repository in Ubuntu LXer Syndicated Linux News 3 05-07-2010 11:20 AM


All times are GMT -5. The time now is 07:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration