我還沒有找到一個內置的方式,但我wrote a small script that I used as a filter:
#!/usr/bin/perl -w
use strict;
use IPC::Open2;
# This quick script will run the native find-requires (first parameter)
# and then strip out packages we don't want listed.
open2(\*IN, \*OUT, @ARGV);
print OUT while (<STDIN>);
close(OUT);
my $list = join('', <IN>);
# Apply my filter(s):
$list =~ s/^libqt-mt.so.*?$//mg;
print $list;
你可以把自己的正則表達式行,在這個例子中,我去掉libqt-mt.so.*
然後,在.spec
文件中:
# Note: 'global' evaluates NOW, 'define' allows recursion later...
%global _use_internal_dependency_generator 0
%global __find_requires_orig %{__find_requires}
%define __find_requires %{_builddir}/%{?buildsubdir}/build/find-requires %{__find_requires_orig}
正如你所看到的,這個腳本是/build/
下的源碼包。
接受的答案無需驗資:我可能無法驗證它在短期內 – a1an