summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilman Blumenbach2015-01-22 13:40:29 +0100
committerTilman Blumenbach2015-01-22 13:40:29 +0100
commit84d251aa294ccf5e5a0add45310d6cc93c50eb7d (patch)
treeb9c647481e5886ab4dfdf6d4a83fbe005e606721
parentb3889c652898ab3284a44e76c6cda4cc9115c0e1 (diff)
downloadaur-84d251aa294ccf5e5a0add45310d6cc93c50eb7d.tar.gz
Minor fixes.
-rwxr-xr-xget_latest_info.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/get_latest_info.py b/get_latest_info.py
index f0323ded539..28a0915a789 100755
--- a/get_latest_info.py
+++ b/get_latest_info.py
@@ -57,14 +57,10 @@ def get_latest_addon_info(addon_id, os):
install = None
for elm in parsed_resp.findall(install_xpath):
if elm.get("status") != "Beta":
- install = elm
+ install = elm.text
break
- # XXX: Quick and dirty: If the response does not contain
- # the version tag, then we fail horribly here. Should be handled
- # properly.
- version = parsed_resp.find("version")
- return version.text, install.text if install is not None else None
+ return parsed_resp.findtext("version"), install
parsed_args = setup_argparser().parse_args()
@@ -73,18 +69,19 @@ try:
version, url = get_latest_addon_info(parsed_args.addon_id, parsed_args.os)
except (requests.exceptions.RequestException, ET.ParseError) as e:
print(
- "Could not retrieve latest information: %s" % e,
+ "E: Could not retrieve latest information: %s" % e,
file=sys.stderr
)
sys.exit(2)
if url is None:
print(
- "No matching URL for OS `%s' found." % parsed_args.os,
+ "E: No match for OS `%s' found." % parsed_args.os,
file=sys.stderr
)
sys.exit(3)
+
url = parsed_args.url_prefix + url
if not parsed_args.pkgbuild: