简体   繁体   中英

Get or Retrieve OS versions and architectures from a library package and download it with launchpad API

How to get OS versions, builds(architectures) versions of packages?

As I know, there are similar Python packages such as launchpadlib. However, I cannot get OS versions, package builds with this library. I have searched but haven't found any package(s) that can give me all this information.

Implementation with html parser:

get os series

[('warty', '4.10'), ('hoary', '5.04'), ('breezy', '5.10'), ('dapper', '6.06'), ('edgy', '6.10'), ('feisty', '7.04'), ('gutsy', '7.10'), ('hardy', '8.04'), ('intrepid', '8.10'), ('jaunty', '9.04'), ('karmic', '9.10'), ('lucid', '10.04'), ('maverick', '10.10'), ('natty', '11.04'), ('oneiric', '11.10'), ('precise', '12.04'), ('quantal', '12.10'), ('raring', '13.04'), ('saucy', '13.10'), ('trusty', '14.04'), ('utopic', '14.10'), ('vivid', '15.04'), ('wily', '15.10'), ('xenial', '16.04'), ('yakkety', '16.10'), ('zesty', '17.04'), ('artful', '17.10'), ('bionic', '18.04')]

get package builds

libc6-dev
['amd64', 'i386', 'powerpc']

get package versions

libc6-dev
['2.3.2.ds1-13ubuntu2', '2.3.2.ds1-13ubuntu2.2', '2.3.2.ds1-13ubuntu2.2', '2.3.2.ds1-13ubuntu2.3']

on Ubuntu:

get your os version with :

 >>> import platform
 >>> platform.platform()

get your build package and versions with :

 >>> import subprocess
 >>> output = subprocess.check_output("apt-cache policy libc6-dev",shell=True)

 >>> manipulate output as string.

the shell output for the apt-cache policy is:

libc6-dev: Installed: 2.23-0ubuntu10 Candidate: 2.23-0ubuntu10
Version table: *** 2.23-0ubuntu10 500 500 http://il.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 100 /var/lib/dpkg/status 2.23-0ubuntu3 500 500 http://il.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM