Open mccun934 opened 12 years ago
easy workaround for this is:
# tito build --rpm --test 2>&1 | grep "is needed" | awk '{print $1}' | xargs yum install -y
At the point that occurs rpmbuild is the one spitting out that dependencies are required. One thought is to look at the BuildRequires in the spec and see if they are already installed. But unsure if there are edge cases where this won't work, say if the BuildRequires is one of the packages that isn't really installed but PROVIDES a dependency. Maybe that might be the approach see what provides the BuildRequires and if something comes back as not providing it, we do the yum install of it? Though I'd like to make this driven by a CLI arg tito build --test --install-deps --rpm
Something like this:
$ rpm -q --whatprovides selinux-policy-doc
no package provides selinux-policy-doc
$ echo $?
1
$ rpm -q --whatprovides python
python-2.7.1-7.fc15.x86_64
$ echo $?
0
This will install missing dependencies:
yum-builddep $( LC_ALL=C tito build --srpm | awk '/Wrote:.*.src.rpm/ { print $2; }' )
Hmm it can be shorten even to: yum-builddep *.spec
personally i like the idea of tito
offering a hint to run yum-builddep <name>.spec
, but i'm not so fond of tito
automatically running a command that needs escalated privileges
How about we do the automatic install ONLY when the -i is passed into to the --rpm command? That option already requires escalated privileges. When the -i is absent we printout the command so user know what to do.
:+1: (along with an updated comment at https://github.com/dgoodwin/tito/blob/master/src/tito/cli.py#L319-320)
sadly, the yum-builddep
command doesn't work on spec files in el5.
see https://github.com/dgoodwin/tito/pull/135
Doesn't mock
take care of this anyway?
I believe I'm running into this issue and am utterly confused by much of the comments here. I thought the whole point of having BuildRequires in your spec was so that the build system would automatically install those packages into your otherwise sterile build root. The mock tool has the --installdeps option, so why doesn't tito's MockBuilder use that option? Or am I overlooking some other point?
Err, wait. I'm getting this with tito.builder.Builder and perhaps not with MockBuilder. I think that explains my confusion.
Turn the below errors into a 'yum install' command would be very very handy