[SOLVED] - rpmbuild: warning: File listed twice

Issues related to applications and software problems
Post Reply
User avatar
warron.french
Posts: 370
Joined: 2014/03/27 20:21:58

[SOLVED] - rpmbuild: warning: File listed twice

Post by warron.french » 2019/03/13 23:33:13

While executing an rpmbuild command against a custom SPEC file I seem to be running into a warning and am not sure what I should do about it precisely.

I see warnings in the format of:

Code: Select all

warning: File listed twice: /the/path/to/file/i_know
There are several hundred lines precisely like this. Did I miss something like I am not supposed to specify paths to include filenames or something like that?
Last edited by warron.french on 2019/03/16 04:49:19, edited 1 time in total.
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 25329
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild: warning: File listed twice

Post by TrevorH » 2019/03/14 00:02:06

It's telling you that you listed that file twice in two different places in the spec file. Maybe it's being selected by a wildcard as well?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
warron.french
Posts: 370
Joined: 2014/03/27 20:21:58

Re: rpmbuild: warning: File listed twice

Post by warron.french » 2019/03/14 01:19:14

Interesting, because I listed every single file explicitly in the %files section by doing something like:

Code: Select all

find /opt/atmvs >> ~/rpmbuild/SPECS/atmvs.spec
Then I used vi to move the files up into the appropriate line space under %files specifically.

Thanks for replying so quickly TrevorH.
Thanks,
War

User avatar
remirepo
Posts: 325
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: rpmbuild: warning: File listed twice

Post by remirepo » 2019/03/14 06:47:52

Such list will include directories (and their content), and files

A simple
%files
/opt/atmvs

Will do the same, without duplicate.
Remi's Repository - Forum - Blog

User avatar
warron.french
Posts: 370
Joined: 2014/03/27 20:21:58

Re: rpmbuild: warning: File listed twice

Post by warron.french » 2019/03/14 23:51:12

Hello remirepo, thanks for the feedback.

To be clear, all that I have to do is simply put:

Code: Select all

%files
/opt/atmvs

That's it?

Thank you.
Thanks,
War

User avatar
warron.french
Posts: 370
Joined: 2014/03/27 20:21:58

Re: rpmbuild: warning: File listed twice

Post by warron.french » 2019/03/14 23:52:44

TrevorH wrote:
2019/03/14 00:02:06
It's telling you that you listed that file twice in two different places in the spec file. Maybe it's being selected by a wildcard as well?
By the way TrevorH, would a good test for proof be to simply egrep -c the line that is supposedly listed twice in the SPEC file?

That would be a valid check, correct?
Thanks,
War

User avatar
TrevorH
Forum Moderator
Posts: 25329
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rpmbuild: warning: File listed twice

Post by TrevorH » 2019/03/15 00:58:23

Remi already provided the best solution and the answer to why it does what it does now. Your find is printing both the filename and the directory in which they reside - the directory one already includes everything inside it.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
warron.french
Posts: 370
Joined: 2014/03/27 20:21:58

Re: rpmbuild: warning: File listed twice

Post by warron.french » 2019/03/16 04:48:58

Thank you both, TrevorH and Remi,
I took your input, applied it, and successfully stopped seeing the "warning: File listed twice" output for every line listed in my %files section of my SPEC file.

All I had to do was consolidate every since file listed under /opt/atmvs and also under /usr/local/bin, and simply put both directories each on a line of their own.

The new %files section looks like this:

Code: Select all

%files
/usr/local/bin
/opt/atmvs
So in essence the warning output is actually mistaken; twice implies 2, and every line for every file of my original SPEC file was saying for fileA, as an example:

warning: File listed twice: /opt/atmvs/fileA

and to make matters worse, the output listed such a line 4x, 5x, or even 6x.

Very confusing, definitely misleading, but thank you for helping me correct this problem to erradicate the warnings.
Thanks,
War

Post Reply