[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)
9 years, 4 months
[PATCH] Added a brute-force command to do a submodule-update after branch-checkout.
by Martin Wilhelm
Reason:
1) We use mock to build a RPM. Mock does all the SCM-stuff via its plugin.
2) This plugin actually does NOT do a "git submodule update --init --recursive" after the branch checkout.
3) This leads to wrong (old) submodule references.
4) Compile error.
---
py/mockbuild/scm.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/py/mockbuild/scm.py b/py/mockbuild/scm.py
index e76293d..dc67bf0 100644
--- a/py/mockbuild/scm.py
+++ b/py/mockbuild/scm.py
@@ -39,6 +39,7 @@ class scmWorker(object):
self.branch = None
self.postget = None
+ self.afterpostget = None
if 'branch' in opts:
self.branch = opts['branch']
if self.branch:
@@ -46,6 +47,7 @@ class scmWorker(object):
self.get = self.get.replace("SCM_BRN", "-r " + self.branch)
elif self.method == "git":
self.postget = "git checkout " + self.branch
+ self.afterpostget = "git submodule update --init --recursive"
elif self.method == "svn":
self.get = self.get.replace("SCM_BRN", self.branch)
else:
@@ -73,6 +75,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 checkout after post command: " + str(self.afterpostget))
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 +93,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.afterpostget:
+ mockbuild.util.do(shlex.split(self.afterpostget), shell=False, cwd=self.src_dir, env=self.environ)
self.log.debug("Fetched sources from SCM")
decorate(traceLog())
--
1.9.1
9 years, 5 months
[mock PATCH] drop the devel link for ppc
by Dan Horák
There is no rawhide for ppc built since F-21.
Signed-off-by: Dan Horák <dan(a)danny.cz>
---
mock.spec.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/mock.spec.in b/mock.spec.in
index 24f3dd5..4de572e 100644
--- a/mock.spec.in
+++ b/mock.spec.in
@@ -66,7 +66,6 @@ ln -s epel-5-x86_64.cfg fedora-5-x86_64-epel.cfg
# more compat, from devel/rawhide rename
ln -s fedora-rawhide-i386.cfg fedora-devel-i386.cfg
ln -s fedora-rawhide-x86_64.cfg fedora-devel-x86_64.cfg
-ln -s fedora-rawhide-ppc.cfg fedora-devel-ppc.cfg
ln -s fedora-rawhide-ppc64.cfg fedora-devel-ppc64.cfg
popd
echo "%defattr(0644, root, mock)" > %{name}.cfgs
--
1.9.3
9 years, 5 months
miscellaneous patches for rpkg
by Lars R. Damerow
Hi all,
I wrote a wrapper for rpkg to assist in our internal RPM builds, and while doing so I fixed a few bugs and added some minor features. Might someone review them and consider them for inclusion upstream?
thanks!
-lars
9 years, 5 months
docker-rpm-builder v0.9 released
by Alan Franzoni
Hello,
after the proof of concept I posted about some months ago I elaborated
a little on the topic.
Pre-release version 0.9 can be found here:
https://github.com/alanfranz/docker-rpm-builder/archive/0.9.tar.gz
What does it do?
It uses docker to build a native rpm from a source directory holding a
.spec and source/patch files; it's VERY useful in CI environments,
wherever you need to build an RPM as your final product.
At the moment is still a bit rough, but it's very small and it should
be very easy to make it fit to anyone's needs.
Advantages over plain mock:
- work on any host distribution as long as it supports docker;
- doesn't require the creation of a source rpm before building a binary
- as far as I have been testing, it's much faster.
If anybody tries it and thinks it's worth contributing, contact me
and/or open tickets or pull request on github.
Bye,
--
My development blog: ollivander.franzoni.eu . @franzeur on Twitter
contact me at public(a)[mysurname].eu
9 years, 6 months
koji mergerepo error?
by Pat Riehecky
Just installed my first EL7 koji slave and merge repo is kicking out
this error:
Traceback (most recent call last):
File "/usr/libexec/kojid/mergerepos", line 276, in <module>
main(sys.argv[1:])
File "/usr/libexec/kojid/mergerepos", line 271, in main
merge.write_metadata()
File "/usr/libexec/kojid/mergerepos", line 251, in write_metadata
mdgen.doPkgMetadata()
File "/usr/lib/python2.7/site-packages/createrepo/__init__.py", line 404, in doPkgMetadata
if '://' in pkg: # remote
File "/usr/lib/python2.7/site-packages/yum/packages.py", line 384, in __getitem__
return getattr(self, key)
TypeError: getattr(): attribute name must be string
Figured I'd pass it along....
--
Pat Riehecky
Scientific Linux developer
http://www.scientificlinux.org/
9 years, 6 months