Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew bundle dump needs updating for new mas list format #952

Closed
emilazy opened this issue Apr 27, 2021 · 2 comments · Fixed by #953
Closed

brew bundle dump needs updating for new mas list format #952

emilazy opened this issue Apr 27, 2021 · 2 comments · Fixed by #953
Labels

Comments

@emilazy
Copy link
Contributor

emilazy commented Apr 27, 2021

As of mas-cli/mas#339, mas list gives a formatted list:

emily@yuyuko ~> mas list
1440147259  AdGuard for Safari       (1.9.13)
497799835   Xcode                    (12.5)
425424353   The Unarchiver           (4.3.1)

This confuses brew bundle dump, which is expecting a format without all the whitespace padding and includes it in the output. This will affect people who use brew's mas integration once a new mas release is cut, which will likely be soon as it fixes the unnecessary upgrade problems many people were having (indeed, I discovered this after building and installing the latest source from HEAD to fix this issue on my system).

emily@yuyuko ~> brew bundle dump --file=- | rg '^mas'
mas "1Password 7             ", id: 1333542190
mas "AdGuard for Safari      ", id: 1440147259
mas "Affinity Photo          ", id: 824183456
…
@jacobbednarz
Copy link
Contributor

makes sense! are you interested in submitting a PR for this? I think it should be pretty straight forward by adding a .strip onto the list before it is later used by the formatter.

emilazy added a commit to emilazy/homebrew-bundle that referenced this issue Apr 27, 2021
This fixes parsing with the format used after the merge of
mas-cli/mas#339:

    emily@yuyuko ~> mas list
    1440147259  AdGuard for Safari  (1.9.13)
    497799835   Xcode               (12.5)
    425424353   The Unarchiver      (4.3.1)
    …

Before:

    irb(main):002:0> app.match(/\A(?<id>\d+)\s+(?<name>.*)\s+\((?<version>[\d.]*)\)\Z/)
    => #<MatchData "1440147259  AdGuard for Safari  (1.9.13)" id:"1440147259" name:"AdGuard for Safari " version:"1.9.13">

After:

    irb(main):003:0> app.match(/\A(?<id>\d+)\s+(?<name>.*?)\s+\((?<version>[\d.]*)\)\Z/)
    => #<MatchData "1440147259  AdGuard for Safari  (1.9.13)" id:"1440147259" name:"AdGuard for Safari" version:"1.9.13">

Fixes Homebrew#952.
@emilazy
Copy link
Contributor Author

emilazy commented Apr 27, 2021

yep, moved this here after I found the responsible bit of code and started working on a patch :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants