ScoopInstaller / Main

📦 The default bucket for Scoop.
https://scoop.sh
The Unlicense
1.58k stars 953 forks source link

[Bug]: Installs already installed packages #5892

Open jakubgs opened 3 months ago

jakubgs commented 3 months ago

Prerequisites

Package Name

Git (and others probably)

Expected/Current Behaviour

When I call scoop from Ansible to install a list of packages it appears to re-install packages that are already installed.

There is no --reinstall flag provided, nor does it exist, it just attempts to reinstall every package specified as argument regardless of whether it's already installed or not. The issue with this behavior is that when you call scoop from a bash instance spawned by OpenSSH installing git package fails due to use of the bash process.

Steps to Reproduce

admin@windows-01 MINGW64 ~
$ scoop info git | grep version
Description : Distributed version control system
Version     : 2.45.2

admin@windows-01 MINGW64 ~
$ scoop install --global git@2.45.2 

Installing 'git' (2.45.2) [64bit] from 'C:\Users\admin\scoop\buckets\main\bucket\git.json'
Loading PortableGit-2.45.2-64-bit.7z.exe from cache
Checking hash of PortableGit-2.45.2-64-bit.7z.exe ... ok.
Extracting dl.7z ... ERROR Exit code was 2!
Failed to extract files from C:\ProgramData\scoop\apps\git\2.45.2\dl.7z.
Log file:
  C:\ProgramData\scoop\apps\git\2.45.2\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/ScoopInstaller/Main/issues/new?title=git%402.45.2%3a+decompress+error

admin@windows-01 MINGW64 ~
$ tail -n4 'C:\ProgramData\scoop\apps\git\2.45.2\7zip.log'
ERROR: Cannot delete output file : Access is denied. : C:\ProgramData\scoop\apps\git\2.45.2\bin\bash.exe
ERROR: Cannot delete output file : Access is denied. : C:\ProgramData\scoop\apps\git\2.45.2\usr\bin\bash.exe
ERROR: Cannot delete output file : Access is denied. : C:\ProgramData\scoop\apps\git\2.45.2\usr\bin\msys-2.0.dll
ERROR: Cannot delete output file : Access is denied. : C:\ProgramData\scoop\apps\git\2.45.2\usr\bin\sh.exe

Possible Solution

Do not reinstall packages that are already installed. Or provide an explicit --no-reinstall or --reinstall flags.

Scoop and Buckets Version

$ scoop --version
Current Scoop version:
d337bb1f (HEAD -> master, tag: v0.4.2, origin/master, origin/HEAD) chore(release): Bump to version 0.4.2 (#5964)

'main' bucket:
e49e18cfb (HEAD -> master, origin/master, origin/HEAD) tup: Update to version 0.8-8

'extras' bucket:
a105a9577 (HEAD -> master, origin/master, origin/HEAD) virtualhere-client: Update to version 5.6.6

'java' bucket:
22628523 (HEAD -> master, origin/master, origin/HEAD) temurin17-nightly-jre: Update to version 17.0.12-5.0.ea

Scoop Config

$ scoop config

last_update                       scoop_branch scoop_repo
-----------                       ------------ ----------
2024-06-07T08:48:28.4964377+02:00 master       https://github.com/ScoopInstaller/Scoop

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.17763.5830
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.5830
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response