Skip to content

Merge in upstream changes #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 27.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Product installation failed.
Use a compatible Mac or select a different build compatible with your current hardware and try again. You may also have success running the script in a VM; the InstallationCheck script in versions of the macOS installer to date skips the checks (and returns success) when run on a VM.

##### Important note for Catalina+
Catalina privacy protections might interfere with the operation of this tool if you run it from ~/Desktop, ~/Documents, ~/Downloads or other directories protected in Catalina. Consider using /Users/Shared (or subdirectory) as the "working space" for this tool.
macOS privacy protections might interfere with the operation of this tool if you run it from ~/Desktop, ~/Documents, ~/Downloads or other directories protected in macOS Catalina or later. Consider using /Users/Shared (or subdirectory) as the "working space" for this tool.


##### Alternate implementations
Expand Down
12 changes: 11 additions & 1 deletion installinstallmacos.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@
'21': 'https://swscan.apple.com/content/catalogs/others/'
'index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9'
'-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog',
'22': 'https://swscan.apple.com/content/catalogs/others/'
'index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9'
'-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog',
'23': 'https://swscan.apple.com/content/catalogs/others/'
'index-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9'
'-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog',
'24': 'https://swscan.apple.com/content/catalogs/others/'
'index-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9'
'-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog'
}

SEED_CATALOGS_PLIST = (
Expand Down Expand Up @@ -634,7 +643,8 @@ def main():
if installer_app:
print("Adding seeding program %s extended attribute to app"
% seeding_program)
xattr.setxattr(installer_app, 'SeedProgram', seeding_program)
xattr.setxattr(installer_app, 'SeedProgram',
seeding_program.encode("UTF-8"))
print('Product downloaded and installed to %s' % sparse_diskimage_path)
if args.raw:
unmountdmg(mountpoint)
Expand Down
62 changes: 62 additions & 0 deletions munki_bundle_pkg_finder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/local/munki/munki-python

import os
import plistlib
import sys

sys.path.append("/usr/local/munki")

from munkilib import dmgutils
from munkilib import pkgutils

if len(sys.argv) != 2:
print('Need exactly one parameter: path to a munki repo!', file=sys.stderr)
sys.exit(-1)

repo_path = sys.argv[1]

all_catalog = os.path.join(repo_path, "catalogs/all")

with open(all_catalog, mode="rb") as FILE:
all_items = plistlib.load(FILE)

dmg_items = [{"name": item["name"],
"version": item["version"],
"location": item["installer_item_location"],
"package_path": item.get("package_path", "")}
for item in all_items
if item.get("installer_item_location", "").endswith(".dmg") and
item.get("installer_type") is None]

items_with_bundle_style_pkgs = []
for item in dmg_items:
full_path = os.path.join(repo_path, "pkgs", item["location"])
print("Checking %s..." % full_path)
mountpoints = dmgutils.mountdmg(full_path)
if mountpoints:
pkg_path = item["package_path"]
if pkg_path:
itempath = os.path.join(mountpoints[0], pkg_path)
if os.path.isdir(itempath):
print("***** %s--%s has a bundle-style pkg"
% (item["name"], item["version"]))
items_with_bundle_style_pkgs.append(item)
else:
for file_item in os.listdir(mountpoints[0]):
if pkgutils.hasValidInstallerItemExt(file_item):
itempath = os.path.join(mountpoints[0], file_item)
if os.path.isdir(itempath):
print("***** %s--%s has a bundle-style pkg"
% (item["name"], item["version"]))
items_with_bundle_style_pkgs.append(item)
break
dmgutils.unmountdmg(mountpoints[0])
else:
print("No filesystems mounted from %s" % full_path)
continue

print("Found %s items with bundle-style pkgs."
% len(items_with_bundle_style_pkgs))
for item in sorted(items_with_bundle_style_pkgs, key=lambda d: d["name"]):
print("%s--%s"% (item["name"], item["version"]))
print(" %s" % item["location"])