bodhi/tools/client.py | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
New commits:
commit 061b8b4fc3f2cfd5aca10a35d932083ef9f34e52
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 27 23:21:51 2008 -0400
Show how many updates we've returned
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index efd26bb..b8ef32e 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -256,11 +256,11 @@ def main():
if data['num_items'] > 1:
for update in data['updates']:
log.info(bodhi.update_str(update, minimal=True))
+ log.info("%d updates found (%d shown)" % (
+ data['num_items'], len(data['updates'])))
else:
for update in data['updates']:
log.info(bodhi.update_str(update))
- log.info("%d updates found (%d shown)" % (
- data['num_items'], len(data['updates'])))
if args:
for arg in args:
data = bodhi.query(package=arg, release=opts.release,
commit 5e9eb4a2de6453a8911912367bc478bcac601dfb
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 27 23:18:20 2008 -0400
Add a '--download' flag to our client
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index aaecb33..efd26bb 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -18,6 +18,7 @@
import sys
import logging
import urllib2
+import subprocess
from getpass import getpass, getuser
from optparse import OptionParser
@@ -66,6 +67,8 @@ def get_parser():
parser.add_option("-R", "--request", action="store",
dest="request",
metavar="STATE", help="Request that an action be
"
"performed on an update
[testing|stable|unpush|obsolete]")
+ parser.add_option("-D", "--download", action="store",
dest="download",
+ metavar="UPDATE", help="Download an update")
## Details
parser.add_option("-s", "--status", action="store",
type="string",
@@ -271,6 +274,28 @@ def main():
request=opts.request, mine=opts.mine,
limit=opts.limit)
print_query(data)
+ elif opts.download:
+ data = bodhi.query(release=opts.release, status=opts.status,
+ type_=opts.type_, bugs=opts.bugs,
+ request=opts.request, mine=opts.mine,
+ limit=opts.limit, package=opts.download)
+ if len(data['updates']) > 1:
+ log.info("%d possible updates were found" %
+ len(data['updates']))
+ for update in data['updates']:
+ log.info(bodhi.update_str(update, minimal=True))
+ else:
+ update = data['updates'][0]
+ log.info("Downloading %s..." % update['title'])
+ p = subprocess.Popen('uname -m', shell=True,
+ stdout=subprocess.PIPE)
+ arch = p.communicate()[0].strip()
+ for build in update['builds']:
+ subprocess.call('koji download-build --arch=%s '
+ '--arch=noarch%s %s' % (arch,
+ arch == 'i686' and '
--arch=i386'
+ or '', build['nvr']),
+ shell=True)
else:
parser.print_help()
break
commit ea616621141360df7d1839b3c72e1ec8fc80e73b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 27 13:46:06 2008 -0400
Bump our client API to 0.5.1
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index cedb68b..aaecb33 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -25,7 +25,7 @@ from optparse import OptionParser
from fedora.client import AuthError, ServerError
from fedora.client.bodhi import BodhiClient
-__version__ = '0.5.0'
+__version__ = '0.5.1'
__description__ = 'Command line tool for interacting with Bodhi'
BODHI_URL = 'https://admin.fedoraproject.org/updates/'