mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #6119 from terminalmage/quickfix
Change behavior of apt._clean_pkglist
This commit is contained in:
commit
1bf40a8f74
@ -463,16 +463,17 @@ def upgrade(refresh=True, **kwargs):
|
||||
|
||||
def _clean_pkglist(pkgs):
|
||||
'''
|
||||
Go through package list and, if any packages have a mix of actual versions
|
||||
and virtual package markers, remove the virtual package markers.
|
||||
Go through package list and, if any packages have more than one virtual
|
||||
package marker and no actual package versions, remove all virtual package
|
||||
markers. If there is a mix of actual package versions and virtual package
|
||||
markers, remove the virtual package markers.
|
||||
'''
|
||||
for key in pkgs.keys():
|
||||
if '1' in pkgs[key] and len(pkgs[key]) > 1:
|
||||
while True:
|
||||
try:
|
||||
pkgs[key].remove('1')
|
||||
except ValueError:
|
||||
break
|
||||
for name, versions in pkgs.iteritems():
|
||||
stripped = filter(lambda x: x != '1', versions)
|
||||
if not stripped:
|
||||
pkgs[name] = ['1']
|
||||
elif versions != stripped:
|
||||
pkgs[name] = stripped
|
||||
|
||||
|
||||
def list_pkgs(versions_as_list=False, removed=False):
|
||||
|
Loading…
Reference in New Issue
Block a user