After my last post Graham Pugh mentioned that the AutoPkg repository list is stored in the AutoPkg preference file as
RECIPE_REPOS with the search order in
He suggested doing a while loop on the
defaults read output but I thought it was just fiddly enough a task in the shell that I might resort to a few lines of Python, so here it is, a Python script to dump out your repository list in search order. Tiny but it does the job.
(Thanks to Graham for taking the time to comment on the previous post, it was just what I needed to get me to spend the few minutes doing this.)
#!/usr/bin/env python3 # repos.py # print the list of AutoPkg repos in search order # NOTE: Totally lacking in any error checking or handling import plistlib from os import path plist = path.expanduser('~/Library/Preferences/com.github.autopkg.plist') fp = open(plist, 'rb') prefs = plistlib.load(fp) search = prefs['RECIPE_SEARCH_DIRS'] repos = prefs['RECIPE_REPOS'] # start at 3 to skip the built in ones for i in range(3, len(search)): print(repos[search[i]]['URL'])