Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 373676 Details for
Bug 506004
Chrome-binary-plugins
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Fetch latest Chrome releases information directly from Google's debian repository
GetLatestChromeReleases.py (text/plain), 1.70 KB, created by
Martin Cyr
on 2014-03-27 22:40:45 UTC
(
hide
)
Description:
Fetch latest Chrome releases information directly from Google's debian repository
Filename:
MIME Type:
Creator:
Martin Cyr
Created:
2014-03-27 22:40:45 UTC
Size:
1.70 KB
patch
obsolete
>def parse_deb822(lines, section_delimiter = None): > found_sections = [] > current_section = None > last_key = None > > for l in lines: > if (section_delimiter and l.startswith(section_delimiter + ':')) or not current_section: > last_key = None > current_section = {} > found_sections.append(current_section) > try: > prefix_len = l.index(':') > last_key = l[:prefix_len] > current_section[last_key] = l[prefix_len + 1:].strip() > except ValueError: > if last_key and l[0] == ' ': > try: > current_section[last_key].append(l.strip()) > except AttributeError: > if (len(current_section[last_key].strip()) == 0): > current_section[last_key] = [l.strip()] > else: > current_section[last_key] = [current_section[last_key], l.strip()] > return found_sections > >def fetch_url_lines(url): > import urllib2 > f = urllib2.urlopen(url) > lines = f.readlines() > f.close() > return lines > >def get_packages(repo_url): > # Fetch Release file to make sure we know where to look for Packages file > all_pkg_src = parse_deb822(fetch_url_lines(repo_url + 'Release')) > pkg_src = [p.split(' ')[2] for p in all_pkg_src[0]['SHA1'] if p.endswith('Packages')][0] > # pkg_src is the repo subpath to Packages file > pkgs = parse_deb822(fetch_url_lines(repo_url + pkg_src), 'Package') > return pkgs > >google_repo_url = "https://dl.google.com/linux/chrome/deb/dists/stable/" >pkgs = get_packages(google_repo_url) > >for p in pkgs: > print(p['Package'] + "-" + p['Version'] + " at " + google_repo_url + p['Filename'])
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 506004
:
373672
| 373676