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

FR (Cache): Add a patch directory (for broken .nupkgs) #51

Open
anonhostpi opened this issue Jan 18, 2024 · 0 comments
Open

FR (Cache): Add a patch directory (for broken .nupkgs) #51

anonhostpi opened this issue Jan 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@anonhostpi
Copy link
Contributor

It appears that it is possible for broken .nupkgs to exist on NuGet:

It may be worth adding a -Patch parameter that overrides the current CachePath behavior.

Currently, CachePath is designed to respect and prioritize PackageManagement's package cache over Import-Package's.

However, due to the aforementioned broken packages, it appears to that a -Patch parameter may be warranted.

To implement such an option, all 3 package types need to be addressed.

  • The easiest is -Path packages. These would simply need to be redirected to a folder other than CachePath
  • The next easiest is likely the Managed-Object packages. These would need to be cloned from PackageManagement's cache to the new -Patch cache
  • The most difficult is the standard Managed package. These packages could be sourced out of either cache.
    • In order to avoid cache conflicts, the -Patch parameter will ignore the existing cache. To accomplish this:
      • The -Offline flag will throw an error for SemVer2 packages
      • The -Offline flag will be respected if the package is found in PM's cache
      • For cached packages provided via -Path, these will need to be cached separately

The -Patch parameter should implement a validateset attribute, where the options are Import and SkipImport. This will allow Import-Package to prep the package without prematurely loading it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant