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

rpmbuild should error out on conflicting %exclude directive #2952

Open
voxik opened this issue Mar 8, 2024 · 4 comments
Open

rpmbuild should error out on conflicting %exclude directive #2952

voxik opened this issue Mar 8, 2024 · 4 comments
Labels

Comments

@voxik
Copy link
Contributor

voxik commented Mar 8, 2024

Given this .spec file:

Summary: summary
Name: newpackage
Version: 1
Release: 1%{?dist}
License: MIT

%description

%install
mkdir -p %{buildroot}%{_tmppath}
echo "foo" > %{buildroot}%{_tmppath}/f

%files
%exclude %{_tmppath}/f
%{_tmppath}/f

%changelog
* Tue Jan 16 2024 Vít Ondruch <[email protected]>
- newpackage

where the file is excluded first and included later, I'd expect that the file will be included in the package, but that is not the case:

$ rpm -qpl /var/lib/mock/fedora-rawhide-x86_64/result/newpackage-1-1.fc40.x86_64.rpm 
(contains no files)

Please note that I have faced the issue when I was trying to remove some subpackages, but keep the files section as similar to the original state as possible.

@pmatilai
Copy link
Member

pmatilai commented Mar 18, 2024

You're instructing rpm to both exclude and include a file. It cannot possibly do both, so the only reasonable course of action is erroring out.

@voxik
Copy link
Contributor Author

voxik commented Mar 18, 2024

the only reasonable course of action is erroring out.

Shall I open separate ticket?

@pmatilai
Copy link
Member

Hmm, it seems I misread the report because I thought that's what was happening, I guess the strange ticket summary set the stage for strange ideas what will follow.

@pmatilai pmatilai reopened this Mar 18, 2024
@pmatilai pmatilai added the bug label Mar 18, 2024
@pmatilai pmatilai changed the title %exclude is too strong rpmbuild should error on conflicting %exclude directive Mar 18, 2024
@pmatilai pmatilai changed the title rpmbuild should error on conflicting %exclude directive rpmbuild should error out on conflicting %exclude directive Mar 18, 2024
@voxik
Copy link
Contributor Author

voxik commented Mar 18, 2024

I have not really wanted to suggest this should be prohibited / reported as an error.

But since duplicates are already detected and reported, reporting this would be in line with that and possibly prevented possible surprises, so that is acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants