Bug 2382363 - maven installation fails in %post scriptlet
Summary: maven installation fails in %post scriptlet
Keywords:
Status: CLOSED DUPLICATE of bug 2382210
Alias: None
Product: Fedora
Classification: Fedora
Component: maven
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Mikolaj Izdebski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-07-21 16:33 UTC by Florence Blanc-Renaud
Modified: 2025-07-22 01:23 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-07-22 01:23:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Florence Blanc-Renaud 2025-07-21 16:33:13 UTC
On a rawhide machine with tha latest bash version and java-21-openjdk-headless, installation of maven package fails.

Reproducible: Always

Steps to Reproduce:
1. dnf update -y bash
2. dnf install -y java-21-openjdk-headless
3. dnf install -y maven
Actual Results:
>>> Running %post scriptlet: maven-1:3.9.11-1.fc43.noarch                                                                         
>>> Non-critical error in %post scriptlet: maven-1:3.9.11-1.fc43.noarch                                                           
>>> Scriptlet output:                                                                                                             
>>> alternatives version 1.33 - Copyright (C) 2001 Red Hat, Inc.                                                                  
>>> This may be freely redistributed under the terms of the GNU Public License.                                                   
>>>                                                                                                                               
>>> usage: alternatives --install <link> <name> <path> <priority>                                                                 
>>>                     [--initscript <service>]                                                                                  
>>>                     [--family <family>]                                                                                       
>>>                     [--follower <follower_link> <follower_name> <follower_path>]*                                             
>>>        alternatives --remove <name> <path>                                                                                    
>>>        alternatives --auto <name>                                                                                             
>>>        alternatives --config <name>                                                                                           
>>>        alternatives --display <name>                                                                                          
>>>        alternatives --set <name> <path/family>                                                                                
>>>        alternatives --list                                                                                                    
>>>        alternatives --remove-all <name>                                                                                       
>>>        alternatives --add-follower <name> <path> <follower_link> <follower_name> <follower_path>                              
>>>        alternatives --remove-follower <name> <path> <follower_name>                                                           
>>>                                                                                                                               
>>> common options: --verbose --test --help --usage --version --keep-missing --keep-foreign                                       
>>>                 --altdir <directory> --admindir <directory>                                                                   
>>>                                                                                                                               
>>> [RPM] %post(maven-1:3.9.11-1.fc43.noarch) scriptlet failed, exit status 2   

Expected Results:
The installation should succeed.

Additional Information:
If the system has bash-5.2.37-3.fc43.x86_64, the issue doesn't happen. The issue is visible only with bash-5.3.0-1.fc43.x86_64.

The problem was also discussed in https://github.com/rpm-software-management/rpm/issues/3865 and it seems that using a single command for update-alternatives may fix the problem.

The %post scriptlet for maven is currently using a multiline command:
https://src.fedoraproject.org/rpms/maven/blob/rawhide/f/maven.spec#_224-229

%post
	
update-alternatives --install %{_bindir}/mvn mvn %{homedir}/bin/mvn %{?maven_alternatives_priority}0 \
--slave %{_bindir}/mvnDebug mvnDebug %{homedir}/bin/mvnDebug \
--slave %{_mandir}/man1/mvn.1.gz mvn1 %{homedir}/bin/mvn.1.gz \
--slave %{_mandir}/man1/mvnDebug.1.gz mvnDebug1 %{homedir}/bin/mvn.1.gz \

Comment 1 Adam Williamson (Red Hat non-Fedora) 2025-07-22 01:23:40 UTC

*** This bug has been marked as a duplicate of bug 2382210 ***


Note You need to log in before you can comment on or make changes to this bug.