aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-10-04 19:04:56 +0000
committerNicolas Vigier <boklm@mageia.org>2011-10-04 19:04:56 +0000
commit432c31f039870b785cb0760c2a8b1ce530326c17 (patch)
tree0bfd6fa6e902652ba084e96003db38a9552804a4 /MgaRepo
parentf752a90d7caa1d43593bab022232ce9ae848c900 (diff)
downloadmgarepo-432c31f039870b785cb0760c2a8b1ce530326c17.tar
mgarepo-432c31f039870b785cb0760c2a8b1ce530326c17.tar.gz
mgarepo-432c31f039870b785cb0760c2a8b1ce530326c17.tar.bz2
mgarepo-432c31f039870b785cb0760c2a8b1ce530326c17.tar.xz
mgarepo-432c31f039870b785cb0760c2a8b1ce530326c17.zip
add function to get maintainer of a package using http
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/MgaRepo/util.py b/MgaRepo/util.py
index e8aef0a..cc08274 100644
--- a/MgaRepo/util.py
+++ b/MgaRepo/util.py
@@ -8,6 +8,7 @@ import sys
import os
import re
from cStringIO import StringIO
+import httplib2
#import commands
# Our own version of commands' getstatusoutput(). We have a commands
@@ -134,5 +135,14 @@ def rellink(src, dst):
steps.extend(csrc[i:])
return os.path.sep.join(steps)
+def maintdb_get(package):
+ dlurl = config.get("maintdb", "url",
+ "http://maintdb.mageia.org/")
+ dlurl = dlurl + "/" + package
+ h = httplib2.Http()
+ resp, content = h.request(dlurl, 'GET')
+ if resp.status != 200:
+ raise Exception('Package cannot be found in maintdb')
+ return content.rstrip('\n')
# vim:et:ts=4:sw=4