Merge branch 'Munki5dev' into bigsur-profiles

This commit is contained in:
Greg Neagle
2020-09-04 08:28:52 -07:00
3 changed files with 29 additions and 6 deletions
@@ -1141,21 +1141,31 @@ func optionalItem(forName name: String) -> OptionalItem? {
}
func getOptionalWillBeInstalledItems() -> [OptionalItem] {
let problem_item_names = getProblemItems().map(
{ return $0["name"] as? String ?? "" }
)
return getOptionalInstallItems().filter(
{
let status = $0["status"] as? String ?? ""
return ["install-requested", "will-be-installed",
"update-will-be-installed", "install-error"].contains(status)
let name = $0["name"] as? String ?? ""
return (["install-requested", "will-be-installed",
"update-will-be-installed", "install-error"].contains(status) &&
!problem_item_names.contains(name))
}
)
}
func getOptionalWillBeRemovedItems() -> [OptionalItem] {
let problem_item_names = getProblemItems().map(
{ return $0["name"] as? String ?? "" }
)
return getOptionalInstallItems().filter(
{
let status = $0["status"] as? String ?? ""
return ["removal-requested", "will-be-removed",
"removal-error"].contains(status)
let name = $0["name"] as? String ?? ""
return (["removal-requested", "will-be-removed",
"removal-error"].contains(status) &&
!problem_item_names.contains(name))
}
)
}
+6 -1
View File
@@ -262,13 +262,18 @@ def run(options_list, catalog_url=None, stop_allowed=False):
continue
# other output
if output.startswith('Progress: '):
if output.startswith(('Progress: ', 'downloading: ', 'preparing: ')):
# Snow Leopard/Lion progress info with '-v' flag
# Big Sur has 'downloading' percent-done
try:
percent = int(output[10:].rstrip('%'))
except ValueError:
percent = -1
display.display_percent_done(percent, 100)
if output.startswith('downloading: '):
display.display_status_minor('Downloading...')
if output.startswith('downloading: '):
display.display_status_minor('Preparing...')
continue
if output.startswith('Software Update Tool'):
# don't display this
+9 -1
View File
@@ -28,6 +28,7 @@ import subprocess
import time
import xattr
# pylint: disable=ungrouped-imports
try:
# Python 2
from urllib2 import quote, unquote
@@ -40,6 +41,7 @@ try:
except ImportError:
# Python 3
from urllib.parse import urlsplit
# pylint: enable=ungrouped-imports
# PyLint cannot properly find names inside Cocoa libraries, so issues bogus
@@ -88,7 +90,13 @@ DEFAULT_CATALOG_URLS = {
'snowleopard-leopard.merged-1.sucatalog'),
'10.15': ('https://swscan.apple.com/content/catalogs/others/'
'index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-'
'lion-snowleopard-leopard.merged-1.sucatalog')
'lion-snowleopard-leopard.merged-1.sucatalog'),
'10.16': ('https://swscan.apple.com/content/catalogs/others/'
'index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-'
'mountainlion-lion-snowleopard-leopard.merged-1.sucatalog'),
'11.0': ('https://swscan.apple.com/content/catalogs/others/'
'index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-'
'mountainlion-lion-snowleopard-leopard.merged-1.sucatalog'),
}
# Preference domain for Apple Software Update.