[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: RPM spec file: using __cp with wildcards



Hi,

On Tue, Jul 19, 2005 at 01:29:17PM -0400, Chester R. Hosey wrote:

> I wish it were that simple. One such line (which I should have included
> initially) reads:
> 
> %{__cp} -a instantclient10_1/sdk/include/*.h \
>     %{buildroot}%{_includedir}/oracle/%{version}/client/
> 
> There are no quotations or attempts to escape the arguments. The problem
> is that rpmbuild escapes the arguments before executing the command; it
> executes as follows:
> 
> + /bin/cp -a 'instantclient10_1/sdk/include/*.h' /var/tmp/oracle-
> instantclient-10.2.0.1-3-root/usr/include/oracle/10.2.0.1/client/

OK, the output is misleading, but the instantclient10_1/sdk/include/*.h
files *really* do not exist (unquoted, wildcards expanded).

As an example, create a shell script /tmp/t1 as follows:

	#!/bin/sh
	mkdir /tmp/t
	cp /etc/pas* /tmp/t/
	cp /etc/gas* /tmp/t/

The files /etc/pas* exist, /etc/gas* does not match any files.
Now run this with "sh -x /tmp/t1" and look at the output:

	+ mkdir /tmp/t
	+ cp /etc/passwd /etc/passwd- /etc/passwd.OLD /tmp/t/
	+ cp '/etc/gas*' /tmp/t/
	cp: cannot stat `/etc/gas*': No such file or directory

So, this is just the way the shell verbose output looks like... ;-)

> I find it hard to imagine that the authors of rpmbuild did not envision
> the possibility that one might wish to use wildcards in included
> scripts.

As you see, this is not the problem, luckily ;-).  Everything is
working fine, but the wildcard just doesn't match any files in
your case.

Cheers,

-- 
--    Jos Vos <jos xos nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]