Re: [PATCH] Add compatibility back in for older versions of Yum.

2009-02-17 Thread James Antill
On Tue, 2009-02-17 at 10:29 -0600, Jeffrey C. Ollie wrote:
> We would like for Koji to remain compatible with the version of Yum
> that is shipped with RHEL 5.
> 
> Signed-off-by: Jeffrey C. Ollie 
> ---
>  builder/mergerepos |   11 +++
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/builder/mergerepos b/builder/mergerepos
> index defb8c1..cfa3a8d 100755
> --- a/builder/mergerepos
> +++ b/builder/mergerepos
> @@ -95,10 +95,13 @@ class RepoMerge(object):
>  self.mdconf.verbose = True
>  self.mdconf.changelog_limit = 3
>  self.yumbase = yum.YumBase()
> -self.yumbase.preconf.fn = '/dev/null'
> -self.yumbase.preconf.init_plugins = False
> -self.yumbase.preconf.debuglevel = 2
> -self.yumbase._getConfig()
> +if hasattr(self.yumbase, 'preconf'):
> +self.yumbase.preconf.fn = '/dev/null'
> +self.yumbase.preconf.init_plugins = False
> +self.yumbase.preconf.debuglevel = 2
> +self.yumbase._getConfig()

 This line should be deleted, the first line after the if will turn the
preconf into the conf.

> +else:
> +self.yumbase._getConfig('/dev/null', init_plugins=False, 
> debuglevel=2)
>  self.yumbase.conf.cachedir = tempfile.mkdtemp()
>  self.yumbase.conf.cache = 0
>  self.archlist = arches
-- 
James Antill 
Fedora

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


[PATCH] Add a "sources" target as an alias for "tarball".

2009-02-17 Thread Jeffrey C. Ollie
This makes building Koji packages directly from a Koji git repository
in Koji possible.  Highly self-referential!

Signed-off-by: Jeffrey C. Ollie 
---
 Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 7432f31..fcd4dca 100644
--- a/Makefile
+++ b/Makefile
@@ -78,6 +78,8 @@ test-tarball:
 tarball: clean
@git archive --format=tar --prefix=$(NAME)-$(VERSION)/ HEAD |bzip2 > 
$(NAME)-$(VERSION).tar.bz2
 
+sources: tarball
+
 srpm: tarball
$(RPM_WITH_DIRS) $(DIST_DEFINES) -bs $(SPECFILE)
 
-- 
1.6.1.3

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


Re: [PATCH] Add compatibility back in for older versions of Yum.

2009-02-17 Thread Mike Bonnet

Jeffrey C. Ollie wrote:

We would like for Koji to remain compatible with the version of Yum
that is shipped with RHEL 5.

Signed-off-by: Jeffrey C. Ollie 
---
 builder/mergerepos |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/builder/mergerepos b/builder/mergerepos
index defb8c1..cfa3a8d 100755
--- a/builder/mergerepos
+++ b/builder/mergerepos
@@ -95,10 +95,13 @@ class RepoMerge(object):
 self.mdconf.verbose = True
 self.mdconf.changelog_limit = 3
 self.yumbase = yum.YumBase()
-self.yumbase.preconf.fn = '/dev/null'
-self.yumbase.preconf.init_plugins = False
-self.yumbase.preconf.debuglevel = 2
-self.yumbase._getConfig()
+if hasattr(self.yumbase, 'preconf'):
+self.yumbase.preconf.fn = '/dev/null'
+self.yumbase.preconf.init_plugins = False
+self.yumbase.preconf.debuglevel = 2
+self.yumbase._getConfig()
+else:
+self.yumbase._getConfig('/dev/null', init_plugins=False, 
debuglevel=2)
 self.yumbase.conf.cachedir = tempfile.mkdtemp()
 self.yumbase.conf.cache = 0
 self.archlist = arches


Applied, thanks for the patch!

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


[PATCH] Add a test-srpm target to the Makefile.

2009-02-17 Thread Jeffrey C. Ollie
---
 Makefile |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 7432f31..51196ea 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,9 @@ tarball: clean
 srpm: tarball
$(RPM_WITH_DIRS) $(DIST_DEFINES) -bs $(SPECFILE)
 
+test-srpm: tarball
+   $(RPM_WITH_DIRS) $(DIST_DEFINES) --define "testbuild 1" -bs $(SPECFILE)
+
 rpm: tarball
$(RPM_WITH_DIRS) $(DIST_DEFINES) -bb $(SPECFILE)
 
-- 
1.6.1.2

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


[PATCH] Add compatibility back in for older versions of Yum.

2009-02-17 Thread Jeffrey C. Ollie
We would like for Koji to remain compatible with the version of Yum
that is shipped with RHEL 5.

Signed-off-by: Jeffrey C. Ollie 
---
 builder/mergerepos |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/builder/mergerepos b/builder/mergerepos
index defb8c1..cfa3a8d 100755
--- a/builder/mergerepos
+++ b/builder/mergerepos
@@ -95,10 +95,13 @@ class RepoMerge(object):
 self.mdconf.verbose = True
 self.mdconf.changelog_limit = 3
 self.yumbase = yum.YumBase()
-self.yumbase.preconf.fn = '/dev/null'
-self.yumbase.preconf.init_plugins = False
-self.yumbase.preconf.debuglevel = 2
-self.yumbase._getConfig()
+if hasattr(self.yumbase, 'preconf'):
+self.yumbase.preconf.fn = '/dev/null'
+self.yumbase.preconf.init_plugins = False
+self.yumbase.preconf.debuglevel = 2
+self.yumbase._getConfig()
+else:
+self.yumbase._getConfig('/dev/null', init_plugins=False, 
debuglevel=2)
 self.yumbase.conf.cachedir = tempfile.mkdtemp()
 self.yumbase.conf.cache = 0
 self.archlist = arches
-- 
1.6.0.6

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


[PATCH] yumbase._getConfig() doesn't take any arguments, use yumbase.preconf to set yum up.

2009-02-17 Thread Jeffrey C. Ollie

Signed-off-by: Jeffrey C. Ollie 
---
 builder/mergerepos |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/builder/mergerepos b/builder/mergerepos
index 4243444..defb8c1 100755
--- a/builder/mergerepos
+++ b/builder/mergerepos
@@ -95,7 +95,10 @@ class RepoMerge(object):
 self.mdconf.verbose = True
 self.mdconf.changelog_limit = 3
 self.yumbase = yum.YumBase()
-self.yumbase._getConfig('/dev/null', init_plugins=False, debuglevel=2)
+self.yumbase.preconf.fn = '/dev/null'
+self.yumbase.preconf.init_plugins = False
+self.yumbase.preconf.debuglevel = 2
+self.yumbase._getConfig()
 self.yumbase.conf.cachedir = tempfile.mkdtemp()
 self.yumbase.conf.cache = 0
 self.archlist = arches
-- 
1.6.0.6

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


Re: [PATCH] Add --chainbuild option.

2009-02-17 Thread Andreas Thienemann
On Tue, 17 Feb 2009, Gianluca Sforna wrote:

> It's just that I found myself needing this just after seeing:
> 
> http://thread.gmane.org/gmane.linux.redhat.fedora.devel/97941
> 
> and Seth's response:
> http://article.gmane.org/gmane.linux.redhat.fedora.devel/97950
> 
> I'm just sharing what I wrapped up in case someone else find it useful...

Hahaha. You win. :)

We've been using something like smock just as a bash script.

regards,
 andreas

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


Re: [PATCH] Add --chainbuild option.

2009-02-17 Thread Gianluca Sforna
On Tue, Feb 17, 2009 at 1:23 PM, Andreas Thienemann  wrote:
>
> Is it really worth it including this in mock?
>
> I'm using the same concept here for our in-house builds. But all the logic
> is part of a shellscript which calls mock for both i386 and x86_64 and
> fills a "local" repository with the results.
> This is similar to what plague and AFAIK koji do.

It's just that I found myself needing this just after seeing:

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/97941

and Seth's response:
http://article.gmane.org/gmane.linux.redhat.fedora.devel/97950

I'm just sharing what I wrapped up in case someone else find it useful...

-- 
Gianluca Sforna

http://morefedora.blogspot.com
http://www.linkedin.com/in/gianlucasforna

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


Re: [PATCH] Add --chainbuild option.

2009-02-17 Thread Andreas Thienemann
On Tue, 17 Feb 2009, Gianluca Sforna wrote:

> With this patch, mock grows a --chainbuild option (and a Require on
> createrepo).
> 
> The --chainbuild option work by creating a local yum repository in the
> resultdir path which is used during the BuildRequires installation
> step.
> The net result is that, when building more than one srpm in the same
> run, later builds can find required packages built in previous steps.

Is it really worth it including this in mock?

I'm using the same concept here for our in-house builds. But all the logic 
is part of a shellscript which calls mock for both i386 and x86_64 and 
fills a "local" repository with the results.
This is similar to what plague and AFAIK koji do.

Might be worthwile considering that.

regards,
 andreas

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list


[PATCH] Add --chainbuild option.

2009-02-17 Thread Gianluca Sforna
With this patch, mock grows a --chainbuild option (and a Require on
createrepo).

The --chainbuild option work by creating a local yum repository in the
resultdir path which is used during the BuildRequires installation
step.
The net result is that, when building more than one srpm in the same
run, later builds can find required packages built in previous steps.
---
 py/mock.py |   11 +++
 py/mock/backend.py |8 
 py/mock/util.py|7 +++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/py/mock.py b/py/mock.py
index 408b421..a801807 100755
--- a/py/mock.py
+++ b/py/mock.py
@@ -113,6 +113,11 @@ def command_parse(config_opts):
  help="chroot name/config file name default: %default",
  default='default')

+parser.add_option("--chainbuild", action="store_true", dest="chainbuild",
+  help="install all built RPMs in the chroot
before continuing"
+  " with the next one",
+  default=False)
+
parser.add_option("--offline", action="store_false", dest="online",
  default=True,
  help="activate 'offline' mode.")
@@ -216,6 +221,7 @@ def setup_default_config_opts(config_opts, unprivUid):
config_opts['build_log_fmt_name'] = "unadorned"
config_opts['root_log_fmt_name']  = "detailed"
config_opts['state_log_fmt_name'] = "state"
+config_opts['chainbuild'] = False
config_opts['online'] = True

config_opts['internal_dev_setup'] = True
@@ -347,6 +353,7 @@ def set_config_opts_per_cmdline(config_opts, options, args):
config_opts['cleanup_on_failure'] = False

config_opts['online'] = options.online
+config_opts['chainbuild'] = options.chainbuild

 decorate(traceLog())
 def do_rebuild(config_opts, chroot, srpms):
@@ -366,6 +373,10 @@ def do_rebuild(config_opts, chroot, srpms):
log.info("Start(%s)  Config(%s)" % (srpm, chroot.sharedRootName))
if config_opts['clean'] and chroot.state() != "clean":
chroot.clean()
+# if chainbuilding, prepare the local repository
+if config_opts['chainbuild']:
+mock.util.createRepo( chroot.resultdir )
+
chroot.init()
chroot.build(srpm, timeout=config_opts['rpmbuild_timeout'])
elapsed = time.time() - start
diff --git a/py/mock/backend.py b/py/mock/backend.py
index 2bc63df..560fb03 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -57,6 +57,14 @@ class Root(object):
self.chrootgid = config['chrootgid']
self.chrootgroup = 'mockbuild'
self.yum_conf_content = config['yum.conf']
+
+if config['chainbuild']:
+self.yum_conf_content = self.yum_conf_content + '\n'.join([
+'[chainbuild]',
+'name=chainbuild',
+'baseurl=file://%s' % os.path.abspath(self.resultdir)
+])
+
self.use_host_resolv = config['use_host_resolv']
self.chroot_file_contents = config['files']
self.chroot_setup_cmd = config['chroot_setup_cmd']
diff --git a/py/mock/util.py b/py/mock/util.py
index f52003e..943d4bb 100644
--- a/py/mock/util.py
+++ b/py/mock/util.py
@@ -262,6 +262,13 @@ def logOutput(fds, logger, returnOutput=1,
start=0, timeout=0):
logger.debug(tail)
return output

+
+decorate(traceLog())
+def createRepo(path):
+cmd = 'createrepo %s' % path
+mock.util.do( cmd, shell=True )
+
+
 # logger =
 # output = [1|0]
 # chrootPath
--
1.6.0.6

--
Fedora-buildsys-list mailing list
Fedora-buildsys-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list