Last active
April 18, 2016 14:23
-
-
Save xenithorb/d93acfbcb807d0a2825c6702796a63ee to your computer and use it in GitHub Desktop.
Just upgrade packages for Bodhi Update ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Usage: | |
# chmod +x get_bodhi_update.py | |
# sudo ./get_bodhi_update.py FEDORA-2016-d67632bb64 | |
# | |
import sys, json, requests, subprocess | |
bodhi_server = "https://bodhi.fedoraproject.org/updates/" | |
bodhi_id = sys.argv[1] | |
# Lucky for us Bodhi outputs JSON when curl'd | |
json_doc = requests.get(bodhi_server + bodhi_id) | |
print(json_doc.status_code, json_doc.url) | |
payload = json.loads(json_doc.text) | |
packages = payload['update']['title'].split() | |
subprocess.call(["dnf", "--enablerepo=updates-testing", "upgrade"] + packages) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment