samdoran / ansible-collection-macos

Ansible collection of roles and modules for use on macOS
8 stars 2 forks source link

Trim the Xcode CLI tools package name in its setup role #2

Closed webknjaz closed 2 years ago

webknjaz commented 2 years ago

The regexp that inspects the softwareupdate -l output returns a string terminated by \r which breaks the install command when it's passed there. This patch fixes the problem by stripping off any whitespace characters around the package name.

samdoran commented 2 years ago

Interesting. I wonder why this worked fine before.

Thanks for the fix.

webknjaz commented 2 years ago

I wonder why this worked fine before.

Maybe because you used Mac on the control node and I use Gentoo? I could imagine them treating line separators differently (LF vs CR+LF). If Mac produces line\r but Linux splits lines with \n, this is exactly what would happen...