[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: RPM spec file: using __cp with wildcards
- From: "Chester R. Hosey" <Chester Hosey gianteagle com>
- To: "Red Hat Enterprise Linux 4 (Nahant) Discussion List" <nahant-list redhat com>
- Subject: Re: RPM spec file: using __cp with wildcards
- Date: Tue, 19 Jul 2005 13:29:17 -0400
On Tue, 2005-07-19 at 18:41 +0200, Jos Vos wrote:
> On Tue, Jul 19, 2005 at 11:29:13AM -0400, Hosey, Chester wrote:
>
> > Running rpmbuild fails because it's escaping arguments passed to 'cp' --
> > instead of:
> > cp sourcedir/*.ext /var/tmp/dest
> > It insists on attempting
> > cp 'sourcedir/*.ext' /var/tmp/dest
> >
> > Obviously cp isn't happy about this.
>
> "cp" does not know about it, the shell won't expand wildcards when
> quoted, so "cp" will see the unexpanded arguments.
>
> > Is there an easy way to get rpmbuild to allow the use of wildcards in
> > commands in the %install section without escaping everything it's asked
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > to pass on to the command line? Is the spec file incorrect? Do I need to
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > rewrite it to explicitly mention every file to be copied?
>
> I do not really understand what the marked text is trying to say, but if
>
> cp 'sourcedir/*.ext' /var/tmp/dest
>
> is really in the spec file, the spec file is definitely wrong.
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/
Of course this command fails. I have not been able to find a way to
prevent rpmbuild from quoting the arguments. Nor have I been able to
find a properly functioning .spec file which uses wildcards. However,
the site from which I obtained this .spec file claims to have used it to
successfully generate RPMs, so I'm at a loss as to whether I've missed
something obvious, or whether I need to bite the bullet and rewrite
the .spec file.
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.
Chet
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]