Skip to content

Conversation

@dyorgio
Copy link
Contributor

@dyorgio dyorgio commented May 22, 2025

Some macOS installations have 4 digits years on Last Modified dates of system_profiler SPApplicationsDataType output.

This commit uses JNA to get the correct date/time format

dyorgio added 2 commits May 22, 2025 11:56
Some macOS installations have 4 digits years on Last Modified dates of system_profiler SPApplicationsDataType output.
This commit includes a fallback to theses scenarios.
@dyorgio
Copy link
Contributor Author

dyorgio commented May 22, 2025

Example of "system_profiler SPApplicationsDataType" output:

    Apache NetBeans:

      Version: 26
      Obtained from: Identified Developer
      Last Modified: 21/05/2025, 12:04
      Kind: iOS
      Signed by: Developer ID Application: Codelerity Ltd. (3KH8VFSK7Q), Developer ID Certification Authority, Apple Root CA
      Location: /Applications/Apache NetBeans.app

@codecov
Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.92%. Comparing base (5637d5e) to head (f942280).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2890      +/-   ##
==========================================
+ Coverage   85.87%   86.92%   +1.05%     
==========================================
  Files          32       32              
  Lines        1423     1423              
  Branches      204      204              
==========================================
+ Hits         1222     1237      +15     
+ Misses        115      107       -8     
+ Partials       86       79       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

I've suggested an alternative fix. Let me know what you think.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a few nits.

Co-authored-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis changed the title Handle 4 years digit format on macOS system_profiler output Handle locale-specific formats on macOS system_profiler output May 24, 2025
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis merged commit c9424a0 into oshi:master May 29, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants