how to prevent rpmbuild from incorrectly discovering a Perl module (non)dependency

Tim Mooney Tim.Mooney at ndsu.edu
Fri May 13 18:40:22 UTC 2011


In regard to: how to prevent rpmbuild from incorrectly discovering a Perl...:

> What I have in one of my Perl programs something like:
>
> print <<EOF;
>    use Net::SNMP::AgentX qw(:types :pdus :errors :options);
> EOF
>
> So my code 'emits' a line of text that contains a 'use' statement,
> but it does not actually ever execute that 'use' statement,
> therefore _my_ package is NOT dependent on that module.

Perl is incredibly challenging to parse correctly, which is why the
dependency generator sometimes gets it wrong.

The easiest thing to try would be to break your very small here-doc into
pieces that the dependency detector won't notice.  Something like

 	print 'use ';
 	print 'Net::SNMP::AgentX ';
 	print 'qw(:types :pdus :errors :options);';
 	print "\n";

or

 	print join(' ', 'use', 'Net::SNMP::AgentX',
 		'qw(:types :pdus :errors :options);'), "\n";

Tim
-- 
Tim Mooney                                             Tim.Mooney at ndsu.edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164


More information about the Rpm-list mailing list