autopkg / nmcspadden-recipes

My own collection of recipes for Autopkg
Apache License 2.0
61 stars 27 forks source link

Syntax Error running Xcode override #68

Open BitsDream opened 1 year ago

BitsDream commented 1 year ago

I made an override, set AppliID, secret.txt and

<key>BETA</key>
<string></string>
<key>PATTERN</key>
<string>((?!.*beta)(?!.*Candidate).*\/Xcode_.*\/Xcode.*.xip)</string>```

(Tried other values for PATTERN too, same error.)

When running the override I get this error. (Sorry, I'm not fluent with python.)

Use of undefined key in variable substitution: 'fixed_filename'
Traceback (most recent call last):
  File "/usr/local/bin/autopkg", line 2758, in <module>
    sys.exit(main(sys.argv))
  File "/usr/local/bin/autopkg", line 2754, in main
    return subcommands[verb]["function"](argv)
  File "/usr/local/bin/autopkg", line 2258, in run_recipes
    autopackager.verify(recipe)
  File "/Library/AutoPkg/autopkglib/__init__.py", line 763, in verify
    step["Processor"], verbose=self.verbose, recipe=recipe, env=self.env
  File "/Library/AutoPkg/autopkglib/__init__.py", line 1052, in get_processor
    _tmp = imp.load_source(processor_name, processor_filename)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/jungeje/Library/AutoPkg/RecipeRepos/com.github.autopkg.nmcspadden-recipes/Xcode/AppleURLSearcher.py", line 117
    if match := re_pattern.search(content):
              ^
SyntaxError: invalid syntax
MScottBlake commented 1 year ago

The := operator was added in Python 3.8. If you update Autopkg, it should fix your issue since it will have a newer version of python.

nmcspadden commented 1 year ago

The current version of python that ships with AutoPkg 2.7+ should already be correct.

On Sun, Dec 11, 2022 at 4:34 PM Scott Blake @.***> wrote:

The := operator was added in Python 3.8. If you update your version of python, it should fix your issue.

— Reply to this email directly, view it on GitHub https://github.com/autopkg/nmcspadden-recipes/issues/68#issuecomment-1345713110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJFTX7JHLXTANI6V5JIUOLWMZXKLANCNFSM6AAAAAASZJ343Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Nick McSpadden @.***

BitsDream commented 1 year ago

OK, this was fixed after updating to Python 3.8+ Thank you