Mock documentation
by Miroslav Suchý
I started editing:
https://fedoraproject.org/wiki/Projects/Mock
And I learned about several plugins, but I'm still not sure what some plugins are exactly doing.
If you know that, or you are even the author of that plugin, I would be very glad, if you can spare few minutes and
enhance the documentation:
https://fedoraproject.org/wiki/Projects/Mock#Plugins
Thanks
--
Miroslav Suchy, RHCE, RHCDS
Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys
8 years, 9 months
[PATCH] enhancements to rpkg
by Mike Bonnet
Hi. Attached are a couple of enhancements to rpkg. The first adds a
--runas option. This allows you to run Koji commands as a different
user, if the Koji hub has been configured to allow you to do so. This
is useful for automation that launches builds on behalf of other users.
The other patch fixes support for password authentication (it has
never worked correctly) and cleans up Koji session creation, so all
relevant config options are passed through to the new session. This
should improve compatibility between the Koji cli and rpkg. Let me know
if there are any questions.
Thanks,
Mike
8 years, 10 months
[PATCH] RPKG: run os.expanduser on the kojiconfig attribute
by Brian Stinson
Sites could specify a path in the user's home directory for the
kojiconfig attribute (e.g. ~/.koji/config-cbs). This is a one-line
change to run os.expanduser() on that path so that file doesn't get
skipped when loading the koji session attributes.
Brian
--
Brian Stinson
bstinson(a)ksu.edu | IRC: bstinson | Bitbucket/Twitter: bstinsonmhk
8 years, 10 months
[PATCH koji] kojid: Compress livecd volume ID (bug 1145264)
by Cole Robinson
(Note, this patch is untested as I'm unsure how to test koji.)
Currently the livecd volume ID is just set to the isoname, shrunk to
32 characters long. With the new longer iso names containing server,
workstation, etc., the resulting volume ID cuts off the Fedora version
number.
Volume IDs are used by libosinfo for distro detection, and by extension
gnome-boxes and virt-manager. But this doesn't work without the actual
version number available.
Compress the volume ID using the same logic that pungi uses. For
workstation livecds this should change volume ID from
Fedora-Live-Workstation-x86_64-2
to
Fedora-Live-WS-x86_64-21...
https://bugzilla.redhat.com/show_bug.cgi?id=1145264
---
builder/kojid | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/builder/kojid b/builder/kojid
index 8b1ea27..9f5758b 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -2673,6 +2673,26 @@ class LiveCDTask(ImageTask):
return manifest
+ def _shortenVolID(self, name, version, release):
+ # Based on code from pungi
+ subsitutions = {
+ 'Workstation': 'WS',
+ 'Server': 'S',
+ 'Cloud': 'C',
+ 'Alpha': 'A',
+ 'Beta': 'B',
+ 'TC': 'T',
+ }
+
+ for k, v in subsitutions.iteritems():
+ if name.contains(k):
+ name.replace(k, v)
+ if version.contains(k):
+ version.replace(k, v)
+
+ volid = "%s-%s-%s" % (name, version, release)
+ return volid[:32]
+
def handler(self, name, version, release, arch, target_info, build_tag, repo_info, ksfile, opts=None):
if opts == None:
@@ -2689,10 +2709,8 @@ class LiveCDTask(ImageTask):
livecd_log = '/tmp/livecd.log'
cmd = ['/usr/bin/livecd-creator', '-c', kskoji, '-d', '-v',
'--logfile', livecd_log, '--cache', cachedir]
- # we set the fs label to the same as the isoname if it exists,
- # taking at most 32 characters
isoname = '%s-%s-%s' % (name, version, release)
- cmd.extend(['-f', isoname[:32]])
+ cmd.extend(['-f', self._shortenVolID(name, version, release)])
# Run livecd-creator
rv = broot.mock(['--cwd', '/tmp', '--chroot', '--'] + cmd)
--
2.1.0
8 years, 10 months
[PATCH] Allow spec file to be in a different path than /
by Thomas
This should allow people to build from git repositories that have a
different structure than Fedora (they still need some magic with
source_cmd). The patch is not too intrusive and can be set per
repository.
Let me know if it can be considered for inclusion. I am happy to rework it.
---
diff --git a/builder/kojid b/builder/kojid
index b3d0d1c..89f9474 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -3292,7 +3292,7 @@ class BuildSRPMFromSCMTask(BaseBuildTask):
self.patch_scm_source(sourcedir, logfile, opts)
# Find and verify that there is only one spec file.
- spec_files = glob.glob("%s/*.spec" % sourcedir)
+ spec_files = glob.glob("%s/%s*.spec" % (sourcedir, scm.spec_path))
if len(spec_files) == 0:
raise koji.BuildError("No spec file found")
elif len(spec_files) > 1:
diff --git a/koji/daemon.py b/koji/daemon.py
index 205f62e..68af212 100644
--- a/koji/daemon.py
+++ b/koji/daemon.py
@@ -200,6 +200,7 @@ class SCM(object):
- use_common (defaults to True, may be set by assert_allowed())
- source_cmd (defaults to ['make', 'sources'], may be set by
assert_allowed())
- scmtype
+ - spec_path
The exact format of each attribute is SCM-specific, but the
structure of the url
must conform to the template above, or an error will be raised.
@@ -220,6 +221,7 @@ class SCM(object):
self.revision = fragment
self.use_common = True
self.source_cmd = ['make', 'sources']
+ self.spec_path = '/'
for scmtype, schemes in SCM.types.items():
if self.scheme in schemes:
@@ -311,6 +313,10 @@ class SCM(object):
else:
# there was nothing after the trailing :,
so they don't want to run a source_cmd at all
self.source_cmd = None
+ # check if spec path is defined
+ if len(scm_tuple) >= 5:
+ if scm_tuple[4]:
+ self.spec_path = scm_tuple[4] + '/'
break
else:
self.logger.warn('Ignoring incorrectly formatted SCM
host:repository: %s' % allowed_scm)
8 years, 11 months
use of SSLv3 in Koji
by Mátyás Selmeci
Hi,
It looks like Koji is hardcoded to use SSLv3 (looking at
CreateSSLContext() in koji/SSLCommon.py) and does not work if SSLv3 is
disabled in the apache configs of koji-hub. Are there any plans to
change that, in light of the POODLE SSLv3 vulnerability?
Thanks,
-Mat
8 years, 11 months
finding koji builds within date range
by Pat Riehecky
Are there any suggestions for finding all koji builds between two dates? The search seems very package name specific and I'm looking for date criteria instead.
Pat
8 years, 11 months
kojid error verbosity
by Pat Riehecky
Would it bother anyone if I updated the kojid error message to be more
verbose if mock fails?
I recently left off a ' in /etc/mock/site-defaults and couldn't figure
out why koji was so upset.....
Pat
--
Pat Riehecky
Scientific Linux developer
http://www.scientificlinux.org/
8 years, 11 months
[PATCH] Added a new boolean parameter called "update_submodules".
by Martin Wilhelm
If set to true and if the scm-method is "git", mock does a
"git submodule update --init --recursive" as a final step after
code checkout and possibly branch-switches.
Without "git submodule update --init --recursive" but with cloned
submodules, all the submodules are master-branch-only. Thus, you can't point
to a submodule's non-master-branch within your main project. Conversely, only
after a "git submodule update --init --recursive" its possible to point to
submodules non-master-branches.
The default for "update_submodules" is False (nothing will happen).
If it is set to True, but there are no submodules, git will simply exit 0.
Other SCM-methodes beside git are actually not supported.
Signed-off-by: Martin Wilhelm <martin(a)system4.org>
---
etc/mock/site-defaults.cfg | 1 +
py/mockbuild/scm.py | 13 +++++++++++++
py/mockbuild/util.py | 1 +
3 files changed, 15 insertions(+)
diff --git a/etc/mock/site-defaults.cfg b/etc/mock/site-defaults.cfg
index ffd6f72..4cec580 100644
--- a/etc/mock/site-defaults.cfg
+++ b/etc/mock/site-defaults.cfg
@@ -118,6 +118,7 @@
# config_opts['scm_opts']['cvs_get'] = 'cvs -d /srv/cvs co SCM_BRN SCM_PKG'
# config_opts['scm_opts']['git_get'] = 'git clone SCM_BRN git://localhost/SCM_PKG.git SCM_PKG'
# config_opts['scm_opts']['svn_get'] = 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG'
+# config_opts['scm_opts']['update_submodules'] = False
# config_opts['scm_opts']['spec'] = 'SCM_PKG.spec'
# config_opts['scm_opts']['ext_src_dir'] = '/dev/null'
# config_opts['scm_opts']['write_tar'] = True
diff --git a/py/mockbuild/scm.py b/py/mockbuild/scm.py
index e76293d..83cce00 100644
--- a/py/mockbuild/scm.py
+++ b/py/mockbuild/scm.py
@@ -55,6 +55,16 @@ class scmWorker(object):
self.get = self.get.replace("SCM_BRN", "trunk")
self.get = self.get.replace("SCM_BRN", "")
+ self.submoduleupdatecommand = None
+ self.update_submodules = opts['update_submodules']
+ if str(self.update_submodules).lower() == "true":
+ # We only support git here. All other SCM methodes are unsupported if update_submodules is set to True.
+ if self.method == "git":
+ self.submoduleupdatecommand = "git submodule update --init --recursive"
+ else:
+ self.log.error("Unsupported SCM method: " + self.method)
+ sys.exit(5)
+
if 'package' in opts:
self.pkg = opts['package']
else:
@@ -73,6 +83,7 @@ class scmWorker(object):
self.log.debug("SCM checkout command: " + self.get)
self.log.debug("SCM checkout post command: " + str(self.postget))
+ self.log.debug("SCM submodule update command: " + str(self.submoduleupdatecommand))
self.environ = os.environ.copy()
# Set HOME properly while checking out from SCM since tools like
# Subversion might have there settings needed to carry out checkout
@@ -90,6 +101,8 @@ class scmWorker(object):
mockbuild.util.do(shlex.split(self.get), shell=False, cwd=self.wrk_dir, env=self.environ)
if self.postget:
mockbuild.util.do(shlex.split(self.postget), shell=False, cwd=self.src_dir, env=self.environ)
+ if self.submoduleupdatecommand:
+ mockbuild.util.do(shlex.split(self.submoduleupdatecommand), shell=False, cwd=self.src_dir, env=self.environ)
self.log.debug("Fetched sources from SCM")
decorate(traceLog())
diff --git a/py/mockbuild/util.py b/py/mockbuild/util.py
index 49e0de4..733d41f 100644
--- a/py/mockbuild/util.py
+++ b/py/mockbuild/util.py
@@ -581,6 +581,7 @@ def setup_default_config_opts(unprivUid, version, pkgpythondir):
'cvs_get': 'cvs -d /srv/cvs co SCM_BRN SCM_PKG',
'git_get': 'git clone SCM_BRN git://localhost/SCM_PKG.git SCM_PKG',
'svn_get': 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG',
+ 'update_submodules': False,
'spec': 'SCM_PKG.spec',
'ext_src_dir': '/dev/null',
'write_tar': False,
--
1.9.1
8 years, 11 months