commit 98d5a070c6c303f650bd963e3763d01e299a7c26
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Fri Aug 31 00:54:58 2018 +0100
Update check_new_version.py script
check_new_version.py | 46 +++++++++++++++++++++++++---------------------
1 file changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/check_new_version.py b/check_new_version.py
index 307097d..523b975 100755
--- a/check_new_version.py
+++ b/check_new_version.py
@@ -7,6 +7,19 @@ import re
import os
import subprocess
+def runme(cmd, env, cwd='.'):
+ """Simple function to run a command and return 0 for success, 1 for
+ failure. cmd is a list of the command and arguments, action is a
+ name for the action (for logging), pkg is the name of the package
+ being operated on, env is the environment dict, and cwd is where
+ the script should be executed from."""
+ try:
+ subprocess.check_call(cmd, env=env, cwd=cwd) #, stderr=None
+ except subprocess.CalledProcessError as e:
+ sys.stderr.write('%s failed: %s\n' % (cmd, e))
+ return 1
+ return 0
+
html =
requests.get('http://repository.spotify.com/pool/non-free/s/spotify-c...
#print (html.text)
@@ -23,7 +36,7 @@ res2 = str_mx.findall(html.text)
regexp =
re.compile('spotify-client_(\d{1,2}[.]\d{1,2}[.]\d{1,3}[.]\d{1,3})([.].*)')
(version32, minor32) = regexp.findall(deb32)[0]
(version64, minor64) = regexp.findall(deb64)[0]
-print (version32, minor32, version64, minor64)
+print ("versions:", version32, minor32, version64, minor64)
spec = open('spotify-client.spec.in').read()
#print (spec)
@@ -34,35 +47,26 @@ spec3 = re.sub(str_mx4, r'\1%s' % minor64, spec)
str_mx5 = re.compile('(Source2:.*?)[.].*')
spec4 = re.sub(str_mx5, r'\1%s' % minor32, spec3)
-def runme(cmd, env, cwd='.'):
- """Simple function to run a command and return 0 for success, 1 for
- failure. cmd is a list of the command and arguments, action is a
- name for the action (for logging), pkg is the name of the package
- being operated on, env is the environment dict, and cwd is where
- the script should be executed from."""
- try:
- subprocess.check_call(cmd, env=env, cwd=cwd) #, stderr=None
- except subprocess.CalledProcessError as e:
- sys.stderr.write('%s failed: %s\n' % (cmd, e))
- return 1
- return 0
-
if spec != spec3:
open('spotify-client.spec.in', 'w').write(spec4)
enviro = os.environ
- pkgcmd = ['rpmdev-bumpspec', '-n', version64, '-c',
'Update to %s%s' % (version64, minor64[:10]), 'spotify-client.spec.in']
+ pkgcmd = ['rpmdev-bumpspec', '-n', version64, '-c',
'Update to %s%s' % (version64, minor64[:10]),
+ 'spotify-client.spec.in']
#pkgcmd = ['rpmdev-bumpspec -n %s -c "Update to %s%s"
spotify-client.spec.in' % (version64, version64, minor64[:4])]
if runme(pkgcmd, enviro):
print('error running runme')
- pkgcmd = ['rpmdev-bumpspec', '-n', version64, '-c',
'Update to %s%s' % (version64, minor64[:10]), 'lpf-spotify-client.spec'] #
2>/dev/null
+ pkgcmd = ['rpmdev-bumpspec', '-n', version64, '-c',
'Update to %s%s' % (version64, minor64[:10]),
+ 'lpf-spotify-client.spec'] # 2>/dev/null
if runme(pkgcmd, enviro):
print('error running runme')
print('rfpkg ci -c && git show')
- print('rfpkg push && rfpkg build --nowait')
- print('git checkout f28 && git merge master && git push
&& rfpkg build --nowait; git checkout master')
- print('git checkout f27 && git merge master && git push
&& rfpkg build --nowait; git checkout master')
- print('git checkout f26 && git merge master && git push
&& rfpkg build --nowait; git checkout master')
-
+ print('rfpkg srpm && mock -r fedora-27-x86_64-rpmfusion_nonfree
--no-clean --rebuild lpf-spotify-client-%s-1.fc30.src.rpm'
+ % version64)
else:
print("Already updated !")
+
+print('rfpkg push && rfpkg build --nowait')
+print('git checkout f29 && git merge master && git push &&
rfpkg build --nowait; git checkout master')
+print('git checkout f28 && git merge master && git push &&
rfpkg build --nowait; git checkout master')
+print('git checkout f27 && git merge master && git push &&
rfpkg build --nowait; git checkout master')