RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1881840 - "%autosetup -a 1 -a 2" ignores the second "-a" while %setup doesn't
Summary: "%autosetup -a 1 -a 2" ignores the second "-a" while %setup doesn't
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rpm
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Packaging Maintenance Team
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-23 08:00 UTC by Tomas Tomecek
Modified: 2020-11-14 08:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-23 11:51:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 546 0 None open RFE: access to multivalued flags 2020-09-23 08:29:42 UTC

Description Tomas Tomecek 2020-09-23 08:00:59 UTC
Description of problem:
%setup accepts multiple "-a" parameters, %autosetup doesn't - it only processes the first one


Version-Release number of selected component (if applicable):
rpm-4.14.2-37.el8.x86_64


How reproducible:
I stumbled upon this while working with gcc's spec file:

Works fine:
%setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2

Only first archive is unpacked:
%autosetup -n gcc-%{version}-%{DATE} -a 1 -a 2

Actual results:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.OBhDab                                           
+ umask 022                                                                                    
+ cd /home/tt/p/c/r/gcc/SOURCES                                                                
+ cd /home/tt/p/c/r/gcc/SOURCES                                                                
+ rm -rf gcc-8.3.1-20191121                                                                    
+ /usr/bin/xz -dc /home/tt/p/c/r/gcc/SOURCES/gcc-8.3.1-20191121.tar.xz                         
+ /usr/bin/tar -xof -                                                                          
+ STATUS=0                                                                                     
+ '[' 0 -ne 0 ']'                                                                              
+ cd gcc-8.3.1-20191121                                                                        
+ /usr/bin/xz -dc /home/tt/p/c/r/gcc/SOURCES/nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.xz                                                                                     
+ /usr/bin/tar -xof -                                                                          
+ STATUS=0                                                                                                                                                                                    
+ '[' 0 -ne 0 ']'                                                                              
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .                                                                                                                                                       
+ echo 'Patch #0 (gcc8-hack.patch):'   

Expected results:
$ rpmbuild -bp ./SPECS/gcc.spec --nodeps --define "_topdir $PWD"                                                                                                       
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.k4ZV4S                                                                                                                                          
+ umask 022                                                                                                                                                                                   
+ cd /tmp/gcc/BUILD                                                                                                                                                                           
+ cd /tmp/gcc/BUILD                                                                                                                                                                           
+ rm -rf gcc-8.3.1-20191121                                                                                                                                                                   
+ /usr/bin/xz -dc /tmp/gcc/SOURCES/gcc-8.3.1-20191121.tar.xz                                                                                                                                  
+ /usr/bin/tar -xof -                                                                                                                                                                         
+ STATUS=0                                                                                                                                                                                    
+ '[' 0 -ne 0 ']'                                                                                                                                                                             
+ cd gcc-8.3.1-20191121                                                                                                                                                                       
+ /usr/bin/xz -dc /tmp/gcc/SOURCES/nvptx-tools-c28050f60193b3b95a18866a96f03334e874e78f.tar.xz                                                                                                
+ /usr/bin/tar -xof -                                                                                                                                                                         
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /usr/bin/xz -dc /tmp/gcc/SOURCES/nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.xz 
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .

Comment 1 Panu Matilainen 2020-09-23 08:29:42 UTC
Known limitation of the macro subsystem (see GH ticket), it doesn't support accessing information from multiple flags.
The difference comes from %autosetup being a macro but %setup being a specific C-implentation in the build code.

There's no easy fix, and I don't expect us to be able to fix it in RHEL 8 or even 9.

Comment 2 Tomas Tomecek 2020-09-23 09:14:39 UTC
Got it, thanks Panu for the explanation.

Feel free to close this as wontfix then.


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