James Antill (james(a)fedoraproject.org) said:
> [root@nostromo ~]# mv /bin /cow
> [root@nostromo ~]# /cow/ln -s /cow /bin
> [root@nostromo ~]# rpm -qf /cow/bash
> bash-4.2.20-1.fc16.x86_64
> [root@nostromo ~]# rpm -qf /bin/bash
> bash-4.2.20-1.fc16.x86_64
>
> rpm should already handle this, no need for the provides.
Good to see everyone still doesn't read what I write.
As I said, rpm _does something_ to make the above work for -qf (the
above even works if you inside /cow ... as long as the /bin symlink
exists!).
However, it _does not_ work, if you put the above in package
provides/requires and try to install them. Eg.
It does, in some cases. Which makes it even more fun.
Take a system with /usr/bin/sdiff.
...
Name: cow
Summary: cow
Version: 1.0
Release: 1
URL:
http://redhat.com/
License: Moo
Requires: /bin/sdiff
%description
Moo
%setup
%build
%install
mkdir -p $RPM_BUILD_ROOT/usr/bin
touch $RPM_BUILD_ROOT%{_bindir}/this-cow-goes-moo
%files
%{_bindir}/*
...
root@nostromo x86_64]# rpm -ivh cow-1.0-1.x86_64.rpm --test
error: Failed dependencies:
/bin/sdiff is needed by cow-1.0-1.x86_64
[root@nostromo x86_64]# mv /bin /cow
[root@nostromo x86_64]# /cow/ln /usr/bin -s /bin
[root@nostromo x86_64]# /cow/rpm -ivh cow-1.0-1.x86_64.rpm --test
Preparing... ########################################### [100%]
Yum installs the package as well.
Bill