mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-24 04:32:46 +00:00
Merge pull request #376 from FrostyX/fix-copy-extra-sources
Fix copy_extra_sources for alternative builders
This commit is contained in:
commit
b9fc2a3f5e
1 changed files with 20 additions and 14 deletions
|
@ -197,21 +197,11 @@ class BuilderBase(object):
|
||||||
mkdir_p(d)
|
mkdir_p(d)
|
||||||
self._check_build_dirs_access(build_dirs)
|
self._check_build_dirs_access(build_dirs)
|
||||||
|
|
||||||
def _copy_extra_sources(self):
|
def copy_extra_sources(self):
|
||||||
"""
|
"""
|
||||||
Copy extra %{SOURCEX} files to the SOURCE folder.
|
Copy extra %{SOURCEX} files to the SOURCE folder.
|
||||||
"""
|
"""
|
||||||
cmd = "spectool -S '%s' --define '_sourcedir %s' | awk '{print $2}'"\
|
return NotImplemented
|
||||||
% (self.spec_file, self.start_dir)
|
|
||||||
sources = getoutput(cmd).split("\n")
|
|
||||||
|
|
||||||
for source in sources[1:]:
|
|
||||||
src = os.path.join(self.rpmbuild_sourcedir, self.tgz_dir, source)
|
|
||||||
if os.path.islink(src) and os.path.isabs(src):
|
|
||||||
src = os.path.join(self.start_dir, os.readlink(src))
|
|
||||||
|
|
||||||
debug("Copying %s -> %s" % (src, self.rpmbuild_sourcedir))
|
|
||||||
shutil.copy(src, self.rpmbuild_sourcedir)
|
|
||||||
|
|
||||||
def srpm(self, dist=None):
|
def srpm(self, dist=None):
|
||||||
"""
|
"""
|
||||||
|
@ -224,7 +214,7 @@ class BuilderBase(object):
|
||||||
if self.test:
|
if self.test:
|
||||||
self._setup_test_specfile()
|
self._setup_test_specfile()
|
||||||
|
|
||||||
self._copy_extra_sources()
|
self.copy_extra_sources()
|
||||||
|
|
||||||
debug("Creating srpm from spec file: %s" % self.spec_file)
|
debug("Creating srpm from spec file: %s" % self.spec_file)
|
||||||
define_dist = ""
|
define_dist = ""
|
||||||
|
@ -270,7 +260,7 @@ class BuilderBase(object):
|
||||||
self._create_build_dirs()
|
self._create_build_dirs()
|
||||||
if not self.ran_tgz:
|
if not self.ran_tgz:
|
||||||
self.tgz()
|
self.tgz()
|
||||||
self._copy_extra_sources()
|
self.copy_extra_sources()
|
||||||
|
|
||||||
cmd = 'rpmbuild {0}'.format(
|
cmd = 'rpmbuild {0}'.format(
|
||||||
" ".join([
|
" ".join([
|
||||||
|
@ -505,6 +495,22 @@ class Builder(ConfigObject, BuilderBase):
|
||||||
# Strip extra dashes if one of the params is empty
|
# Strip extra dashes if one of the params is empty
|
||||||
return tag_format.format(**kwargs).strip('-')
|
return tag_format.format(**kwargs).strip('-')
|
||||||
|
|
||||||
|
def copy_extra_sources(self):
|
||||||
|
"""
|
||||||
|
Copy extra %{SOURCEX} files to the SOURCE folder.
|
||||||
|
"""
|
||||||
|
cmd = "spectool -S '%s' --define '_sourcedir %s' | awk '{print $2}'"\
|
||||||
|
% (self.spec_file, self.start_dir)
|
||||||
|
sources = getoutput(cmd).split("\n")
|
||||||
|
|
||||||
|
for source in sources[1:]:
|
||||||
|
src = os.path.join(self.rpmbuild_sourcedir, self.tgz_dir, source)
|
||||||
|
if os.path.islink(src) and os.path.isabs(src):
|
||||||
|
src = os.path.join(self.start_dir, os.readlink(src))
|
||||||
|
|
||||||
|
debug("Copying %s -> %s" % (src, self.rpmbuild_sourcedir))
|
||||||
|
shutil.copy(src, self.rpmbuild_sourcedir)
|
||||||
|
|
||||||
def tgz(self):
|
def tgz(self):
|
||||||
"""
|
"""
|
||||||
Create the .tar.gz required to build this package.
|
Create the .tar.gz required to build this package.
|
||||||
|
|
Loading…
Add table
Reference in a new issue