Skip to content

Commit

Permalink
Always create archive of sources when building RPM (#540)
Browse files Browse the repository at this point in the history
The SCM plugin for mock will create an archive of the sources if either
this marker file is present in the root of the project or the
`write_tar` option is specified in mock's configuration.

The way bloom works, we always want to archive the sources, but this
isn't the default configuration of the SCM plugin. Writing this marker
file means one less configuration is necessary when consuming the
release repo to build the RPMs with mock.

Signed-off-by: Scott K Logan <[email protected]>
  • Loading branch information
cottsay authored Jul 18, 2019
1 parent d885e58 commit 07d8f1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bloom/generators/rpm/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,10 @@ def generate_rpm(self, package, rpm_distro, rpm_dir='rpm'):
template_files = process_template_files('.', subs)
# Remove any residual template files
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
# Add changes to the rpm folder
execute_command('git add ' + rpm_dir)
# Add marker file to tell mock to archive the sources
open('.write_tar', 'a').close()
# Add marker file changes to the rpm folder
execute_command('git add .write_tar ' + rpm_dir)
# Commit changes
execute_command('git commit -m "Generated RPM files for ' +
rpm_distro + '"')
Expand Down

0 comments on commit 07d8f1c

Please sign in to comment.