mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Fix avoid double packages from repo alien
This commit is contained in:
parent
8aa202c1be
commit
90aa7f1581
1 changed files with 17 additions and 0 deletions
|
@ -28,6 +28,7 @@ import subprocess
|
||||||
|
|
||||||
from slpkg.utils import Utils
|
from slpkg.utils import Utils
|
||||||
from slpkg.messages import Msg
|
from slpkg.messages import Msg
|
||||||
|
from slpkg.splitting import split_package
|
||||||
from slpkg.__metadata__ import MetaData as _meta_
|
from slpkg.__metadata__ import MetaData as _meta_
|
||||||
|
|
||||||
from slpkg.pkg.find import find_package
|
from slpkg.pkg.find import find_package
|
||||||
|
@ -362,6 +363,8 @@ class PackageManager(object):
|
||||||
pkg_list.append(line[15:].strip())
|
pkg_list.append(line[15:].strip())
|
||||||
if line.startswith("PACKAGE SIZE (compressed): "):
|
if line.startswith("PACKAGE SIZE (compressed): "):
|
||||||
pkg_size.append(line[26:].strip())
|
pkg_size.append(line[26:].strip())
|
||||||
|
if repo == "alien":
|
||||||
|
return alien_filter(pkg_list, pkg_size)
|
||||||
return pkg_list, pkg_size
|
return pkg_list, pkg_size
|
||||||
|
|
||||||
def list_lib(self, repo):
|
def list_lib(self, repo):
|
||||||
|
@ -399,3 +402,17 @@ class PackageManager(object):
|
||||||
find = pkg[:-4]
|
find = pkg[:-4]
|
||||||
if find_package(find, self.meta.pkg_path):
|
if find_package(find, self.meta.pkg_path):
|
||||||
return pkg
|
return pkg
|
||||||
|
|
||||||
|
|
||||||
|
def alien_filter(packages, sizes):
|
||||||
|
"""This filter avoid list double packages from
|
||||||
|
alien repository
|
||||||
|
"""
|
||||||
|
cache, npkg, nsize = [], [], []
|
||||||
|
for p, s in zip(packages, sizes):
|
||||||
|
name = split_package(p)[0]
|
||||||
|
if name not in cache:
|
||||||
|
cache.append(name)
|
||||||
|
npkg.append(p)
|
||||||
|
nsize.append(s)
|
||||||
|
return npkg, nsize
|
||||||
|
|
Loading…
Reference in a new issue