Skip to content

Commit 74a6708

Browse files
authored
More snapshot updates
* Set Kernel -> Add -> [#] -> Comment to kext name * Set UEFI -> Drivers -> [#] -> Comment to .efi driver name only if "Comment" exists in driver_add (for 0.7.3 vs 0.7.4) * Don't consider ignored values for the to_add list when forcing snapshot schema
1 parent c3e8f46 commit 74a6708

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Scripts/plistwindow.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def oc_snapshot(self, event = None, clean = False):
10291029
kdict = {
10301030
# "Arch":"Any",
10311031
"BundlePath":os.path.join(path,name)[len(oc_kexts):].replace("\\", "/").lstrip("/"),
1032-
"Comment":"",
1032+
"Comment":name,
10331033
"Enabled":True,
10341034
# "MaxKernel":"",
10351035
# "MinKernel":"",
@@ -1231,8 +1231,8 @@ def oc_snapshot(self, event = None, clean = False):
12311231
"Enabled":True,
12321232
"Path":os.path.join(path,name)[len(oc_drivers):].replace("\\", "/").lstrip("/") # Strip the /Volumes/EFI/
12331233
}
1234-
# Add our snapshot custom entries, if any
1235-
for x in driver_add: new_driver_entry[x] = driver_add[x]
1234+
# Add our snapshot custom entries, if any - include the name of the .efi driver if the Comment
1235+
for x in driver_add: new_driver_entry[x] = name if x.lower() == "comment" else driver_add[x]
12361236
drivers_list.append(new_driver_entry)
12371237
drivers = [] if clean else tree_dict["UEFI"]["Drivers"]
12381238
for driver in sorted(drivers_list, key=lambda x: x.get("Path","").lower() if driver_add else x):
@@ -1266,11 +1266,12 @@ def oc_snapshot(self, event = None, clean = False):
12661266
# Check if we're forcing schema - and ensure values line up
12671267
if self.controller.settings.get("force_snapshot_schema",False):
12681268
ignored = ["Comment","Enabled","Path","BundlePath","ExecutablePath","PlistPath","Name"]
1269-
for entries,values in ((tree_dict["ACPI"]["Add"],acpi_add),(tree_dict["Kernel"]["Add"],kext_add),(tree_dict["Misc"]["Tools"],tool_add)):
1269+
for entries,values in ((tree_dict["ACPI"]["Add"],acpi_add),(tree_dict["Kernel"]["Add"],kext_add),(tree_dict["Misc"]["Tools"],tool_add),(tree_dict["UEFI"]["Drivers"],driver_add)):
1270+
if not values: continue # Skip if nothing to check
12701271
for entry in entries:
12711272
to_remove = [x for x in entry if not x in values and not x in ignored]
1272-
to_add = [x for x in values if not x in entry and not x in ignored]
1273-
for add in to_add: entry[add] = values[add]
1273+
to_add = [x for x in values if not x in entry]
1274+
for add in to_add: entry[add] = os.path.basename(entry.get("Path",values[add])) if add.lower() == "comment" else values[add]
12741275
for rem in to_remove: entry.pop(rem,None)
12751276

12761277
# Now we remove the original tree - then replace it

0 commit comments

Comments
 (0)