Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
243 stars 34 forks source link

Cannot properly use package version constraints #320

Closed Vince0789 closed 2 years ago

Vince0789 commented 4 years ago

The caret operator does not seem to work with plugin resources.

INFO: github.com/Southclaws/pawn-redis:^1.0.4 downloading plugin resource for windows
WARN: failed to ensure plugin github.com/Southclaws/pawn-redis:^1.0.4 failed to get plugin github.com/Southclaws/pawn-redis:^1.0.4 from net: GET https://api.github.com/repos/Southclaws/pawn-redis/releases/tags/%5E1.0.4: 404 Not Found []
INFO: github.com/Southclaws/pawn-requests:^0 downloading plugin resource for windows
WARN: failed to ensure plugin github.com/Southclaws/pawn-requests:^0 failed to get plugin github.com/Southclaws/pawn-requests:^0 from net: GET https://api.github.com/repos/Southclaws/pawn-requests/releases/tags/%5E0: 404 Not Found []

Additionally, any of the greater than/lower than constraints also do not work:

INFO: github.com/Southclaws/pawn-redis:>=1.0.4 <2.0.0 downloading plugin resource for windows
WARN: failed to ensure plugin github.com/Southclaws/pawn-redis:>=1.0.4 <2.0.0 failed to get plugin github.com/Southclaws/pawn-redis:>=1.0.4 <2.0.0 from net: failed to create cache directory for package resources: mkdir C:\Users\Vince\.samp\plugins\pawn-redis\>=1.0.4 <2.0.0: The filename, directory name, or volume label syntax is incorrect.
INFO: github.com/Southclaws/pawn-requests:>=0.8.7 <1.0.0 downloading plugin resource for windows
WARN: failed to ensure plugin github.com/Southclaws/pawn-requests:>=0.8.7 <1.0.0 failed to get plugin github.com/Southclaws/pawn-requests:>=0.8.7 <1.0.0 from net: failed to create cache directory for package resources: mkdir C:\Users\Vince\.samp\plugins\pawn-requests\>=0.8.7 <1.0.0: The filename, directory name, or volume label syntax is incorrect.

Might be related to #204 but I'm not sure.

Southclaws commented 4 years ago

I can't really remember how this works but I think the : character isn't necessary, so you do user/repo^version or something.

Vince0789 commented 4 years ago

In that case the documentation is incorrect. I tried it without the colon. It doesn't error out, but it doesn't have have any effect either; it's giving me the generic Downloading newest plugin because no version is specified message and it doesn't download the version specified by the constraint.

Southclaws commented 4 years ago

Ah okay, never mind then.

It could be an issue with https://github.com/Masterminds/semver then.

Southclaws commented 4 years ago

Oh wait, I know why, I vaguely remember some odd edge-case that meant semver versioning constraints could not work with plugins.