FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Build System

 
 
LinkBack Thread Tools
 
Old 10-20-2010, 08:04 PM
Ville Skyttä
 
Default Install build deps with yum-builddep.

No longer need to screen-scrape resolvedep and feed that to yum
install, and we have a chance to get BuildConflicts handing "for free"
(when RHBZ #614191 is done in yum(-builddep)).
---
mock.spec.in | 2 +-
py/mock/backend.py | 33 ++++++++++++++++++++++-----------
2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/mock.spec.in b/mock.spec.in
index e2580ca..0949975 100644
--- a/mock.spec.in
+++ b/mock.spec.in
@@ -18,7 +18,7 @@ Source: https://fedorahosted.org/mock/attachment/wiki/MockTarballs/%{name}-%{ver
URL: http://fedoraproject.org/wiki/Projects/Mock
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: python >= 2.4, yum >= 2.4, tar, pigz, python-ctypes, python-decoratortools, usermode
+Requires: python >= 2.4, yum >= 2.4, yum-utils >= 1.1.9, tar, pigz, python-ctypes, python-decoratortools, usermode
Requires: createrepo
Requires(pre): shadow-utils
BuildRequires: python-devel
diff --git a/py/mock/backend.py b/py/mock/backend.py
index ba0ad14..81a98d0 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -69,6 +69,7 @@ class Root(object):
self.chroot_file_contents = config['files']
self.chroot_setup_cmd = config['chroot_setup_cmd']
self.yum_path = '/usr/bin/yum'
+ self.yum_builddep_path = '/usr/bin/yum-builddep'
self.macros = config['macros']
self.more_buildreqs = config['more_buildreqs']
self.cache_topdir = config['cache_topdir']
@@ -444,23 +445,28 @@ class Root(object):
"""figure out deps from srpm. call yum to install them"""
try:
self.uidManager.becomeUser(0, 0)
+
+ def _yum_and_check(cmd):
+ output = self._yum(cmd, returnOutput=1)
+ for line in output.split('
'):
+ if line.lower().find('No Package found for'.lower()) != -1:
+ raise mock.exception.BuildError, "Bad build req: %s. Exiting." % line
+
+ # first, install pre-existing deps and configured additional ones
arg_string = self.preExistingDeps
for hdr in mock.util.yieldSrpmHeaders(srpms, plainRpmOk=1):
# get text buildreqs
- a = mock.util.requiresTextFromHdr(hdr)
- b = mock.util.getAddtlReqs(hdr, self.more_buildreqs)
- for item in mock.util.uniqReqs(a, b):
+ for item in mock.util.getAddtlReqs(hdr, self.more_buildreqs):
arg_string = arg_string + " '%s'" % item
-
- # everything exists, okay, install them all.
- # pass build reqs (as strings) to installer
if arg_string != "":
- output = self._yum('resolvedep %s' % arg_string, returnOutput=1)
- for line in output.split('
'):
- if line.lower().find('No Package found for'.lower()) != -1:
- raise mock.exception.BuildError, "Bad build req: %s. Exiting." % line
+ # everything exists, okay, install them all.
+ # pass build reqs (as strings) to installer
+ _yum_and_check('resolvedep %s' % arg_string)
# nothing made us exit, so we continue
self._yum('install %s' % arg_string, returnOutput=1)
+
+ # install actual build dependencies
+ _yum_and_check("builddep '%s'" % "' '".join(srpms))
finally:
self.uidManager.restorePrivs()

@@ -676,7 +682,12 @@ class Root(object):
if not self.online:
cmdOpts = "-C"

- cmd = '%s --installroot %s %s %s' % (self.yum_path, self.makeChrootPath(), cmdOpts, cmd)
+ # invoke yum-builddep instead of yum if cmd is builddep
+ exepath = self.yum_path
+ if cmd.startswith("builddep "):
+ exepath = self.yum_builddep_path
+ cmd = cmd[len("builddep "):]
+ cmd = '%s --installroot %s %s %s' % (exepath, self.makeChrootPath(), cmdOpts, cmd)
self.root_log.debug(cmd)
output = ""
try:
--
1.7.2.3

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 10-21-2010, 04:24 PM
Mike McLean
 
Default Install build deps with yum-builddep.

On 10/20/2010 04:04 PM, Ville Skyttä wrote:
> No longer need to screen-scrape resolvedep and feed that to yum
> install, and we have a chance to get BuildConflicts handing "for free"
> (when RHBZ #614191 is done in yum(-builddep)).

I'm not sure we should rush to require a brand new yum feature. A lot of
folks use mock in a lot of different environments.

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 10-21-2010, 05:56 PM
Ville Skyttä
 
Default Install build deps with yum-builddep.

On Thursday 21 October 2010, Mike McLean wrote:
> On 10/20/2010 04:04 PM, Ville Skyttä wrote:
> > No longer need to screen-scrape resolvedep and feed that to yum
> > install, and we have a chance to get BuildConflicts handing "for free"
> > (when RHBZ #614191 is done in yum(-builddep)).
>
> I'm not sure we should rush to require a brand new yum feature. A lot of
> folks use mock in a lot of different environments.

Could you elaborate what you mean by "brand new yum feature"?

yum-builddep has been available at least since 2005, and the version of it
that has the necessary command line options since 2007.

BuildConflicts processing doesn't exist in yum or yum-builddep yet, it's just
a feature/improvement that mock would gain automatically (if/when implemented)
if it used yum-builddep instead of the current resolvedep screen-scraping. It
is by no means a required thing.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 10-21-2010, 07:16 PM
Mike McLean
 
Default Install build deps with yum-builddep.

On 10/21/2010 01:56 PM, Ville Skyttä wrote:
> On Thursday 21 October 2010, Mike McLean wrote:
>> On 10/20/2010 04:04 PM, Ville Skyttä wrote:
>>> No longer need to screen-scrape resolvedep and feed that to yum
>>> install, and we have a chance to get BuildConflicts handing "for free"
>>> (when RHBZ #614191 is done in yum(-builddep)).
>>
>> I'm not sure we should rush to require a brand new yum feature. A lot of
>> folks use mock in a lot of different environments.
>
> Could you elaborate what you mean by "brand new yum feature"?
>
> yum-builddep has been available at least since 2005, and the version of it
> that has the necessary command line options since 2007.
>
> BuildConflicts processing doesn't exist in yum or yum-builddep yet, it's just
> a feature/improvement that mock would gain automatically (if/when implemented)
> if it used yum-builddep instead of the current resolvedep screen-scraping. It
> is by no means a required thing.

Sorry, I misread your comment. No worries then.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 12-04-2010, 03:17 PM
Ville Skyttä
 
Default Install build deps with yum-builddep.

On Wednesday 20 October 2010, Ville Skyttä wrote:
> No longer need to screen-scrape resolvedep and feed that to yum
> install, and we have a chance to get BuildConflicts handing "for free"
> (when RHBZ #614191 is done in yum(-builddep)).
> ---
> mock.spec.in | 2 +-
> py/mock/backend.py | 33 ++++++++++++++++++++++-----------
> 2 files changed, 23 insertions(+), 12 deletions(-)

Pushed.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 

Thread Tools




All times are GMT. The time now is 11:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org