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

During upgrade, removal of old choco.exe does not use absolute path on Linux #2369

Closed
TheCakeIsNaOH opened this issue Sep 18, 2021 · 1 comment

Comments

@TheCakeIsNaOH
Copy link
Member

TheCakeIsNaOH commented Sep 18, 2021

What You Are Seeing?

On Linux Mono, the removal of old chocolatey binaries does not use an absolute path:
Attempting to delete file "opt/chocolatey/chocolatey.dll.old".

On Windows, an absolute path is used:
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".

What is Expected?

It should be:
Attempting to delete file "/opt/chocolatey/chocolatey.dll.old".

How Did You Get This To Happen? (Steps to Reproduce)

  1. Build and run Linux docker image
  2. choco --debug --verbose inside the container

Output Log

Full Log Output

Chocolatey v0.11.1-14-g874fb5a9
Chocolatey is running on Linux v 5.10.0.0
Attempting to delete file "opt/chocolatey/chocolatey.dll.old".
Attempting to delete file "/opt/chocolatey/choco.exe.old".
Attempting to create directory "/opt/chocolatey/helpers".
Attempting to create directory "/opt/chocolatey/helpers/functions".
Attempting to create directory "/opt/chocolatey/redirects".
Attempting to create directory "/opt/chocolatey/tools".
Command line: /opt/chocolatey/choco.exe --verbose --debug --allow-unofficial
Received arguments: --verbose --debug --allow-unofficial
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 1

@TheCakeIsNaOH
Copy link
Member Author

This appears to be caused by the front slash being trimmed off:
#2025 (comment)

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 18, 2021
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
@gep13 gep13 added this to the vNext milestone Sep 19, 2021
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Sep 19, 2021
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
gep13 added a commit that referenced this issue Sep 19, 2021
(#2369 #2370) Do not trim forward slashs prefixes on Linux
@gep13 gep13 added 4 - Done and removed 3 - Review labels Sep 19, 2021
@gep13 gep13 closed this as completed Sep 19, 2021
gep13 pushed a commit that referenced this issue Sep 21, 2021
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Sep 22, 2021
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
@gep13 gep13 changed the title Removing old chocolatey exe does not use absolute path on Linux During upgrade removal of old choco.exe does not use absolute path on Linux Jan 17, 2022
@pauby pauby changed the title During upgrade removal of old choco.exe does not use absolute path on Linux During upgrade, removal of old choco.exe does not use absolute path on Linux Jan 17, 2022
tapika pushed a commit to tapika/swupd that referenced this issue Jan 30, 2022
Prevents the absolute path to the current assembly from being converted
to a relative path by the removal of the first forward slash.
Applicable to non-windows platforms, leaves Windows alone.

Co-Authored-By: Kim J. Nordmo <1474648+AdmiringWorm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants