Skip to content

Commit

Permalink
fix(ci): the latest package version coincides with the version apt wo…
Browse files Browse the repository at this point in the history
…uld choose (#12909)
  • Loading branch information
nstng committed Jun 3, 2022
1 parent 1a1e2b3 commit 334c4a3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lte/gateway/release/pydep
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,14 @@ def get_latest_apt_pkg_version(pkgname: str, py2: bool = False) -> Optional[str]
"""
cache = apt.Cache()
sys_pkgname = gen_sys_package_name(pkgname, py2)

try:
avail_versions = cache[sys_pkgname].versions
package = cache[sys_pkgname]
except KeyError:
# package isn't available
return None

latest = None
for v in avail_versions:
if not latest or v.version > latest:
latest = v.version

return latest
return package.candidate.version


def gen_fpm_dep_string_from_lockfile(lockfile_str: str) -> str:
Expand Down

0 comments on commit 334c4a3

Please sign in to comment.