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 02-10-2010, 12:56 AM
Seth Vidal
 
Default createrepo run after mock

This is a patch to run createrepo on the contents of the resultdir after a
successful mock run. In theory this lets us suck those contents over for
koji to have available.


-sv
commit 1915fd7199dded59860c5d79af4d52efbed6ab0f
Author: Seth Vidal <skvidal@fedoraproject.org>
Date: Tue Feb 9 20:52:15 2010 -0500

createrepo_on_rpms

add an option to have createrepo run on the rpms in the resultdir for a successful build.

diff --git a/etc/mock/site-defaults.cfg b/etc/mock/site-defaults.cfg
index 0ee2082..6da9290 100644
--- a/etc/mock/site-defaults.cfg
+++ b/etc/mock/site-defaults.cfg
@@ -45,6 +45,10 @@
# config_opts['cleanup_on_success'] = 1
# config_opts['cleanup_on_failure'] = 1

+# if you want mock to automatically run createrepo on the rpms in your
+# resultdir.
+# config_opts['createrepo_on_rpms'] = True
+
################################################## ###########################
#
# plugin related. Below are the defaults. Change to suit your site
diff --git a/mock.spec.in b/mock.spec.in
index 8b91b40..fe739fe 100644
--- a/mock.spec.in
+++ b/mock.spec.in
@@ -19,6 +19,7 @@ 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, gzip, python-ctypes, python-decoratortools, usermode
+Requires: createrepo
Requires(pre): shadow-utils
BuildRequires: python-devel

diff --git a/py/mock.py b/py/mock.py
index f4794ac..eea493c 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -227,6 +227,7 @@ def setup_default_config_opts(config_opts, unprivUid):
config_opts['cleanup_on_success'] = 1
config_opts['cleanup_on_failure'] = 1

+ config_opts['createrepo_on_rpms'] = True
# (global) plugins and plugin configs.
# ordering constraings: tmpfs must be first.
# root_cache next.
@@ -378,6 +379,12 @@ def do_rebuild(config_opts, chroot, srpms):
if config_opts["cleanup_on_success"]:
log.info("Cleaning up build root ('clean_on_success=True')")
chroot.clean()
+
+ if config_opts["createrepo_on_rpms"]:
+ log.info("Running createrepo on binary rpms in resultdir")
+ cmd = ['/usr/bin/createrepo', '-d', '-q', '-x', '*.src.rpm', chroot.resultdir]
+ mock.util.do(cmd)
+
except (Exception, KeyboardInterrupt):
elapsed = time.time() - start
log.error("Exception(%s) Config(%s) %d minutes %d seconds"
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 12:57 AM
Roland McGrath
 
Default createrepo run after mock

> This is a patch to run createrepo on the contents of the resultdir after a
> successful mock run. In theory this lets us suck those contents over for
> koji to have available.

Awesome. I've wanted for ages to have koji scratch/user/task_12345 dirs
contain repodata.


Thanks,
Roland
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 03:18 AM
Seth Vidal
 
Default createrepo run after mock

On Tue, 9 Feb 2010, Roland McGrath wrote:

>> This is a patch to run createrepo on the contents of the resultdir after a
>> successful mock run. In theory this lets us suck those contents over for
>> koji to have available.
>
> Awesome. I've wanted for ages to have koji scratch/user/task_12345 dirs
> contain repodata.
>

exactly what we are driving at.

-sv

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 07:24 PM
Mike McLean
 
Default createrepo run after mock

On 02/09/2010 08:56 PM, Seth Vidal wrote:
> This is a patch to run createrepo on the contents of the resultdir after
> a successful mock run. In theory this lets us suck those contents over
> for koji to have available.

If the target is koji, then mock is the wrong place for this code.

...unless folks that use plain mock need this?
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 07:28 PM
Seth Vidal
 
Default createrepo run after mock

On Wed, 10 Feb 2010, Mike McLean wrote:

> On 02/09/2010 08:56 PM, Seth Vidal wrote:
>> This is a patch to run createrepo on the contents of the resultdir after
>> a successful mock run. In theory this lets us suck those contents over
>> for koji to have available.
>
> If the target is koji, then mock is the wrong place for this code.

why? You make the repo at end time then with ticket 167 (that I just
filed for koji) it sucks up the repodata, too.

I talked to mbonnet about this on irc - he seemed fine w/it.


> ...unless folks that use plain mock need this?

sure. why not?

-sv

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 07:41 PM
Roland McGrath
 
Default createrepo run after mock

> On 02/09/2010 08:56 PM, Seth Vidal wrote:
> > This is a patch to run createrepo on the contents of the resultdir after
> > a successful mock run. In theory this lets us suck those contents over
> > for koji to have available.
>
> If the target is koji, then mock is the wrong place for this code.
>
> ...unless folks that use plain mock need this?

I'd certainly like it to be de rigeur for all the canonical forms of
producing a passel of rpms. A directory full of fresh built rpms that is
not directly usable as a repo is just silly!
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 07:59 PM
Mike McLean
 
Default createrepo run after mock

On 02/10/2010 03:28 PM, Seth Vidal wrote:
>> If the target is koji, then mock is the wrong place for this code.
>
> why? You make the repo at end time then with ticket 167 (that I just
> filed for koji) it sucks up the repodata, too.

It's just as easy to run the createrepo from koji instead. Then,
- no need to add the dep to mock
- works in koji regardless of mock version

Furthermore, the repodata generated here will not mesh with the
resulting layout on the hub.
- for scratch builds all the rpms are placed in a single dir
- for non-scratch builds the src rpms get split off and any noarch
rpms generated from a non-noarch build will land in the noarch dir

>> ...unless folks that use plain mock need this?
>
> sure. why not?

I guess I've never understood how this is helpful. In order to use it,
you'd first need to configure the repo, which means creating/editing a
config file. And you go to that effort so that yum can resolve a handful
of inter-subpackage deps for you?

I've just never had any trouble running yum localinstall against the
resulting rpms.

All that being said, I'm not opposed to doing something -- I just want
to do it right. In particular, I'd like to get a solid handle on the
range of use cases that are behind this request.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 08:06 PM
Mike McLean
 
Default createrepo run after mock

On 02/10/2010 03:41 PM, Roland McGrath wrote:
> I'd certainly like it to be de rigeur for all the canonical forms of
> producing a passel of rpms. A directory full of fresh built rpms that is
> not directly usable as a repo is just silly!

Not every set of rpms makes sense as a repo.

If you really feel this way, perhaps you should request that yum support
a dir of rpms as a repo.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 08:08 PM
Seth Vidal
 
Default createrepo run after mock

On Wed, 10 Feb 2010, Mike McLean wrote:

> Furthermore, the repodata generated here will not mesh with the
> resulting layout on the hub.
> - for scratch builds all the rpms are placed in a single dir
> - for non-scratch builds the src rpms get split off and any noarch
> rpms generated from a non-noarch build will land in the noarch dir
>
>>> ...unless folks that use plain mock need this?
>>
>> sure. why not?
>
> I guess I've never understood how this is helpful. In order to use it,
> you'd first need to configure the repo, which means creating/editing a
> config file. And you go to that effort so that yum can resolve a handful
> of inter-subpackage deps for you?

look at the yum tmprepo plugin - it handles the above w/o config edits.


use cases:

1. have repodata immediately available for all koji scratch builds for
easier testing
2. possibly speed up assembling repos from multiple koji builds
3. it's a pretty light-weight hit to go ahead and generate this data
4. it means if you know the taskid then you can find another good index to
slurp down all the files related to it.

those are ones I can think of off the top of my head.

I don't have a strong preference toward this being in mock - when we were
talking about it on irc yesterday it seemed the easiest place to put it.

-sv

-sv

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys
 
Old 02-10-2010, 08:09 PM
Seth Vidal
 
Default createrepo run after mock

On Wed, 10 Feb 2010, Mike McLean wrote:

> On 02/10/2010 03:41 PM, Roland McGrath wrote:
>> I'd certainly like it to be de rigeur for all the canonical forms of
>> producing a passel of rpms. A directory full of fresh built rpms that is
>> not directly usable as a repo is just silly!
>
> Not every set of rpms makes sense as a repo.
>
> If you really feel this way, perhaps you should request that yum support
> a dir of rpms as a repo.

repoquery --repofrompath and the yum tmprepo plugin.

-sv

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

Thread Tools




All times are GMT. The time now is 04:28 PM.

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