commit fe67123c73f041f55b839fce96e30f461cb0caa7
Author: Elan Ruusamäe <[email protected]>
Date:   Thu Jan 31 22:45:02 2019 +0200

    use python3 repomd module to query rpm repo
    
    https://pypi.org/project/repomd/

 update-source.sh | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/update-source.sh b/update-source.sh
index 4575a56..207124f 100755
--- a/update-source.sh
+++ b/update-source.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -e
+
 die() {
        echo >&2 "$0: $*"
        exit 1
@@ -33,25 +35,21 @@ esac
 
 sourceurl=https://dl.google.com/linux/$product/rpm/stable/$arch
 
-set -e
-
 fetch_version() {
-       echo -n "Fetching latest version... "
-       t=$(mktemp)
+       echo -n "Fetching latest version for $branch... "
 
        # poldek is buggy, see https://bugs.launchpad.net/poldek/+bug/1026762
        #poldek -q --st=metadata --source "$sourceurl/" --update
        #poldek -q --skip-installed --st=metadata --source "$sourceurl/" --cmd 
"ls google-chrome-$branch" > $t
 
-       repodata=primary-$branch-$(date +%Y%m%d).xml
-       [ "$cache" = "yes" ] || rm -f "$repodata"
-       test -e $repodata || {
-               wget $sourceurl/repodata/primary.xml.gz -O $repodata.gz
-               gzip -dc $repodata.gz > $repodata || test -s $repodata
-       }
-       perl -ne 'm{<name>google-'$product-$branch'</name>} and m{<version 
epoch="0" ver="([\d.]+)" rel="(\d+)"/>} and print "$1 $2"' > $t < $repodata
-
-       set -- $(sed -re "s,^.+-([^-]+)-([^-]+).$arch$,\1 \2," $t)
+       set -- $(
+               python3 <<-EOF
+                       import repomd
+                       repo = repomd.load('$sourceurl')
+                       package = repo.find('google-$product-$branch')
+                       print("{0} {1}".format(package.version, 
package.release))
+               EOF
+       )
 
        ver=$1
        rel=$2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/google-chrome.git/commitdiff/1032ffed182f68749708bbe1bfc5c69b5b721598

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to