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

Version pinning / ignoring #386

Open
bosconb opened this issue May 22, 2021 · 2 comments
Open

Version pinning / ignoring #386

bosconb opened this issue May 22, 2021 · 2 comments

Comments

@bosconb
Copy link

bosconb commented May 22, 2021

Notes

Version pinning is a subset of regex version inclusion/exclusion; pinning ignores all updates (potentially at different semver levels), while version inclusion/exclusion could ignore specific versions or version regexes.

Pinning to the current version would exclude .* regex matches; pinning to 1.x would include only 1\..* regex matches.

e.g., as per #668, it looks like apps can report a version in the local install that is different than the version reported in the Mac App Store for the same release (e.g. 1.1.18 vs. 1.0.0.1.18).

To avoid updates being continually offered from 1.1.18 to 1.0.0.1.18, a user might want to ignore version 1.0.0.1.18.

To simplify things, all version inclusion/exclusion should probably be handled by mas pin <app-id> with mutually exclusive options. While "pin" might not exactly properly linguistically apply to all it would handle, it's close enough, while other terms might cause more confusion than they're worth. From here on, "pin" will be a substitute for "version inclusion/exclusion".

mas unpin <app-id> would remove all existing pins for the specified app.

mas pin with no arguments will displays all pins.

mas pin [--force] (<semver-level-name>|<semver-level-index>|--include <regex>|--exclude <regex>) <app-id>

--force would be required to change an existing pin. If a pin exists for <app-id> but --force wasn't supplied, mas will output an error.

mas pin … <app-id> requires one of the following mutually exclusive argument sets:

  • a single <semver-level-name>: e.g., major, minor, patch, prerelease, etc. (I don't know if the Mac App Store supports prerelease versions, or if mas can work with TestFlight)
  • a single <semver-level-index>: if 1-based, 1 = major, 2 = minor, 3 = patch, etc., because version component depth could be arbitrary (could be 0-based, but 1-based is likely better)
    • only apply to dot-separated decimal number components?
    • don't apply to -<prerelease>?
  • --include <regex>: include only versions that fully match <regex>
  • --exclude <regex>: exclude only versions that fully match <regex>

Original Issue

Please add a mechanism to exclude a list of apps from being output or affected by mas outdated or mas upgrade.

Both a command-line option and a file-based config could be useful, the former for one-off exclusion, the latter for ongoing exclusion.

@rgoldberg rgoldberg changed the title Feature Request: add option for costomized APP list to ignore mas action Feature Request: Excluded app list for outdated & upgrade May 24, 2021
@chris-araman
Copy link
Contributor

This sounds like version pinning. Something like brew pin seems like it might address this.

We could persist this in a property list.

@justinmayer
Copy link

Until mas outdated has the ability to suppress unhelpful messages like…

Warning: Identifier XXXXXXXXXX not found in store. Was expected to identify <NAME_OF_APP>.

… I found two ways to handle it in the interim. One is by suppressing stderr:

mas outdated 2>/dev/null

The other way is more "surgical" and allows other warnings and errors to be displayed:

script -q /dev/null mas outdated | grep -v "not found in store"

Hope this is of help to someone. ✨

@rgoldberg rgoldberg changed the title Feature Request: Excluded app list for outdated & upgrade Feature Request: version pinning Sep 12, 2024
@rgoldberg rgoldberg changed the title Feature Request: version pinning Version pinning Sep 14, 2024
@rgoldberg rgoldberg changed the title Version pinning Version pinning / ignoring Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants