Skip to content

Conversation

@classabbyamp
Copy link
Member

@classabbyamp classabbyamp commented Dec 31, 2025

replaces isn't honoured if the package to be replaced is currently being installed. This fixes a corner case where a transitional package could be installed along with its replacement, when it should be "ignored" and only the new package installed.

This requires transaction commits to not fail if a replaced package isn't installed when it should be "removed".

Also, indicate to the user that a package is being replaced, with details about what replaced what shown in verbose output, not just debug output.

fixes: #667

both installed at once:

xbps-install -R /tmp/reproducer -r /tmp/reproducer/root -v B
Found B-1.0_1 in repository /tmp/reproducer
Found A-1.0_1 in repository /tmp/reproducer
Package `B-1.0_1' will be replaced by `A-1.0_1'

Name Action    Version           New version            Download size
A    install   -                 1.0_1                  - 
B    replaced  -                 -                      - 

Space available on disk:        26GB

Do you want to continue? [Y/n] 

[*] Verifying package integrity
A-1.0_1: verifying SHA256 hash...

[*] Collecting package files
A-1.0_1: collecting files...

[*] Unpacking packages
A-1.0_1: unpacking ...
A-1.0_1: unpacked file `./file' (0 bytes)

[*] Configuring unpacked packages
A-1.0_1: configuring ...
A-1.0_1: installed successfully.

0 downloaded, 1 installed, 0 updated, 1 configured, 1 removed, 0 on hold.

updating to transitional:

xbps-install -R /tmp/reproducer -r /tmp/repro2/root -v B    
Found B-1.0_1 in repository /tmp/reproducer
Found A-1.0_1 in repository /tmp/reproducer
Package `B-1.0_1' will be replaced by `A-1.0_1'

Name Action    Version           New version            Download size
A    install   -                 1.0_1                  - 
B    replaced  0.1_1             -                      - 

Space available on disk:        26GB

Do you want to continue? [Y/n] 

[*] Verifying package integrity
A-1.0_1: verifying SHA256 hash...

[*] Collecting package files
A-1.0_1: collecting files...
B-0.1_1: collecting files...

[*] Unpacking packages
A-1.0_1: unpacking ...
B-1.0_1: removing ...
B-1.0_1: removed successfully.

[*] Configuring unpacked packages
A-1.0_1: configuring ...
A-1.0_1: installed successfully.

0 downloaded, 1 installed, 0 updated, 1 configured, 1 removed, 0 on hold.

@classabbyamp classabbyamp marked this pull request as draft December 31, 2025 03:33
…tion

replaces isn't honoured if the package to be replaced is currently being installed.
This fixes a corner case where a transitional package could be installed
along with its replacement, when it should be "ignored" and only the new
package installed.

This requires transaction commits to not fail if a replaced package
isn't installed when it should be "removed".

Also, indicate to the user that a package is being replaced, with
details about what replaced what shown in verbose output, not just debug output.

fixes: void-linux#667
@classabbyamp classabbyamp changed the title support replacing packages on initial install lib: handle replaces if replaced pkg is installed in the same transaction Dec 31, 2025
@classabbyamp classabbyamp marked this pull request as ready for review December 31, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replaces does not affect the transaction installing the replaced package

1 participant