[packages/google-chrome] update also flash version automatically

glen glen at pld-linux.org
Sat Sep 14 10:32:50 CEST 2013


commit 9af080dabc93520b43b8f1298d64857cf5d162fd
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Sep 14 11:32:33 2013 +0300

    update also flash version automatically

 update-source.sh | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/update-source.sh b/update-source.sh
index 4ffccb2..c9074b5 100755
--- a/update-source.sh
+++ b/update-source.sh
@@ -1,6 +1,12 @@
 #!/bin/sh
+# product name
+product=chrome
+# name
+name=google-$product
+# this package
+specfile=$name.spec
 # arch to check package. irrelevant for actual arch
-arch=x86_64
+arch=i386
 # branch: stable, beta, unstable. default: stable
 branch=${1:-stable}
 
@@ -13,7 +19,7 @@ case "${branch}" in
 		;;
 esac
 
-sourceurl=http://dl.google.com/linux/chrome/rpm/stable/$arch
+sourceurl=http://dl.google.com/linux/$product/rpm/stable/$arch
 
 set -e
 
@@ -25,24 +31,33 @@ t=$(mktemp)
 #poldek -q --skip-installed --st=metadata --source "$sourceurl/" --cmd "ls google-chrome-$branch" > $t
 
 wget -c $sourceurl/repodata/primary.xml.gz
-zcat primary.xml.gz | perl -ne 'm{<name>google-chrome-'$branch'</name>} and m{<version epoch="0" ver="([\d.]+)" rel="(\d+)"/>} and print "$1 $2"' > $t
+zcat primary.xml.gz | perl -ne 'm{<name>google-'$product-$branch'</name>} and m{<version epoch="0" ver="([\d.]+)" rel="(\d+)"/>} and print "$1 $2"' > $t
 
 set -- $(sed -re "s,^.+-([^-]+)-([^-]+).$arch$,\1 \2," $t)
 
-rm -f primary.xml.gz $t
+rm -f primary.xml.gz
 
 ver=$1
 rev=$2
 
+# extract flash version
+rpm=$name-$branch-$ver-$rev.$arch.rpm
+wget -c $sourceurl/$rpm
+wd=$(mktemp -d)
+echo ./opt/google/chrome/PepperFlash/manifest.json > $t
+rpm2cpio $rpm | cpio -i -E $t --to-stdout > manifest.json
+flashv=$(awk -F'"' '/version/{print $4}' manifest.json)
+
 echo "$ver-$rev"
 
-specfile=google-chrome.spec
 oldrev=$(awk '/^%define[ 	]+svnrev[ 	]+/{print $NF}' $specfile)
-if [ "$oldrev" != "$rev" ]; then
+oldflash=$(awk '/^%define[ 	]+flashv[ 	]+/{print $NF}' $specfile)
+if [ "$oldrev" != "$rev" -o "$oldflash" != "$flashv" ]; then
 	echo "Updating $specfile for $ver r$rev"
 	sed -i -e "
 		s/^\(%define[ \t]\+svnrev[ \t]\+\)[0-9]\+\$/\1$rev/
 		s/^\(%define[ \t]\+state[ \t]\+\)[a-z]\+\$/\1$branch/
+		s/^\(%define[ \t]\+flashv[ \t]\+\)[a-z]\+\$/\1$flashv/
 		s/^\(Version:[ \t]\+\)[.0-9]\+\$/\1$ver/
 	" $specfile
 	../builder -ncs -g $specfile || :
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/google-chrome.git/commitdiff/9af080dabc93520b43b8f1298d64857cf5d162fd



More information about the pld-cvs-commit mailing list