Skip to content

Commit 7aa1921

Browse files
authored
Create MunkiLooseVersion-Test.py
Test how Munki will evaluate versions and decide which is the highest (newest) Original written by Greg Neagle and shared in the MacAdmins Slack Added to this repo so I can easily find it when needed
1 parent ae69b24 commit 7aa1921

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

MunkiLooseVersion-Test.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/local/munki/munki-python
2+
3+
# Test how Munki will evaluate versions and decide which is the highest (newest)
4+
# Original written by Greg Neagle and shared in the MacAdmins Slack
5+
# Added to this repo so I can easily find it when needed
6+
7+
import sys
8+
9+
sys.path.insert(0, "/usr/local/munki")
10+
from munkilib.pkgutils import MunkiLooseVersion
11+
12+
# Enter version numbers to test in the list below:
13+
14+
version_numbers = [
15+
"1",
16+
"2",
17+
"3",
18+
"AI-243.24978.46.2431.13363775",
19+
"AI-243.22562.218.2431.13114758",
20+
"AI-242.21829.142.2421.12409432",
21+
]
22+
23+
print(*sorted(version_numbers, key=MunkiLooseVersion, reverse=True), sep="\n")

0 commit comments

Comments
 (0)