lorax-composer: Fix installing files from [[repos.git]] to /
rpmfluff was including / in the rpm, which conflicts with
filesystem.rpm
The rpm globs are pretty limited, and we don't actually know the file
paths until later, so we have to use a glob or a directory.
So when the destination is / it now uses /* to select all the files and
sub-directories in the archive. The limitation of this is that it cannot
support dotfiles directly under /, they will cause a rpmbuild error.
For destinations other than / it uses the name of the directory, so
dotfiles are fine in that situation.
(cherry picked from commit 049f68cb60
)
Related: rhbz#1709594
This commit is contained in:
parent
666e1fa9f0
commit
ff9421c848
@ -134,10 +134,17 @@ class GitRpmBuild(SimpleRpmBuild):
|
||||
sourceIndex = self.add_source(GitArchiveTarball(gitRepo))
|
||||
self.section_build += "tar -xvf %s\n" % self.sources[sourceIndex].sourceName
|
||||
dest = os.path.normpath(gitRepo["destination"])
|
||||
# Prevent double slash root
|
||||
if dest == "/":
|
||||
dest = ""
|
||||
self.create_parent_dirs(dest)
|
||||
self.section_install += "cp -r %s $RPM_BUILD_ROOT/%s\n" % (gitRepo["rpmname"], dest)
|
||||
self.section_install += "cp -r %s/. $RPM_BUILD_ROOT/%s\n" % (gitRepo["rpmname"], dest)
|
||||
sub = self.get_subpackage(None)
|
||||
sub.section_files += "%s/" % dest
|
||||
if not dest:
|
||||
# / is special, we don't want to include / itself, just what's under it
|
||||
sub.section_files += "/*\n"
|
||||
else:
|
||||
sub.section_files += "%s/\n" % dest
|
||||
|
||||
def make_git_rpm(gitRepo, dest):
|
||||
""" Create an rpm from the specified git repo
|
||||
|
Loading…
Reference in New Issue
Block a user