shaka-project / express-chocolatey-server

Simple Chocolatey package server for Express
5 stars 5 forks source link

Can't provide two versions of package #2

Closed Kikilluh closed 4 months ago

Kikilluh commented 1 year ago

Hello,

First, thanks for your solution, this is great. However, i have a problem and i don't know if it's me or the application which isn't build for that. The repo works fine for simple packages, but, I can't provide two version of a package. I can install putty if there is only one version available on express-choco-server.

Here the logs when there is two packages available :

# I have two packages putty, one in version 0.78 and one in 0.74
Loaded packages: [
{
  id: 'putty',
  version: '0.74',
  title: 'PuTTY',
  ...
  ...
  id: 'putty',
  version: '0.78',
  title: 'PuTTY'
choco install putty --version="0.74" -s test
Chocolatey v1.2.0
Installing the following packages:
putty
By installing, you accept licenses for the packages.
putty not installed. The package was not found with the source(s) listed.
 Source(s): 'https://TEST'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Version was specified as '0.74'. It is possible that version
 does not exist for 'putty' at the source specified.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
 assistance.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - putty - putty not installed. The package was not found with the source(s) listed.
 Source(s): 'https://TEST'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Version was specified as '0.74'. It is possible that version
 does not exist for 'putty' at the source specified.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
 assistance.

#############################
#Same message for
choco install putty --version="0.78" -s test

#############################
choco install putty -s test
Chocolatey v1.2.0
Installing the following packages:
putty
By installing, you accept licenses for the packages.
Progress: Downloading putty.portable 0.78... 100%
putty not installed. An error occurred during installation:
 La référence d'objet n'est pas définie à une instance d'un objet.
putty package files install failed with exit code 1. Performing other installation steps.
The install of putty was NOT successful.
putty not installed. An error occurred during installation:
 La référence d'objet n'est pas définie à une instance d'un objet.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - putty (exited 1) - putty not installed. An error occurred during installation:
 La référence d'objet n'est pas définie à une instance d'un objet.

--> Is there something that i miss ?


I have an other problem wich is maybe linked to this one :
I internalize for example powershell-core with dependancies, like kb3118401.1.0.5.nupkg , but i still can't install powershell-core :

# KBs & packages are well pushed on express-chocolatey-server
{
express-chocolatey-server-nodeserver-1  |     id: 'KB3118401',
express-chocolatey-server-nodeserver-1  |     version: '1.0.5',
express-chocolatey-server-nodeserver-1  |     title: 'Update for Universal C Runtime in Windows (version 10.0.10586)',
express-chocolatey-server-nodeserver-1  |     authors: 'Microsoft',
[...]
{
express-chocolatey-server-nodeserver-1  |       id: 'powershell-core',
express-chocolatey-server-nodeserver-1  |       version: '7.1.3.20210315',
express-chocolatey-server-nodeserver-1  |       title: 'powershell-core (Install)',
express-chocolatey-server-nodeserver-1  |       authors: 'Microsoft',
choco install powershell-core
Progress: Downloading powershell-core 7.1.3.20210315... 100%
powershell-core not installed. An error occurred during installation:
 Unable to resolve dependency 'KB3118401'.

choco install KB3118401
KB3118401 - KB3118401 not installed. The package was not found with the source(s) listed.

--> Is there something specific for KBs ?

Thanks !

joeyparrish commented 1 year ago

I've never tried multiple versions of the same package, and I've never tried KBs.

I think this particular route would cause collisions with multiple versions:

https://github.com/shaka-project/express-chocolatey-server/blob/46da16edb3e460691a0c124ac4f8ca335f3e8abf/chocolatey-server.js#L218

The download path is a lookup by name, but not by version. That route is referenced here:

https://github.com/shaka-project/express-chocolatey-server/blob/46da16edb3e460691a0c124ac4f8ca335f3e8abf/chocolatey-server.js#L97-L102

The source is only ~200 lines, built on expressjs. Some parts of it are hacky, because it was purpose-built to host our packages (https://github.com/shaka-project/shaka-lab/). But I tried to make it relatively generic, and it's all open source. Feel free to tinker and make improvements. PRs are always welcome!

github-actions[bot] commented 4 months ago

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.