Skip to content

Commit 07d8f1c

Browse files
authored
Always create archive of sources when building RPM (#540)
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]>
1 parent d885e58 commit 07d8f1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bloom/generators/rpm/generator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,10 @@ def generate_rpm(self, package, rpm_distro, rpm_dir='rpm'):
781781
template_files = process_template_files('.', subs)
782782
# Remove any residual template files
783783
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
784-
# Add changes to the rpm folder
785-
execute_command('git add ' + rpm_dir)
784+
# Add marker file to tell mock to archive the sources
785+
open('.write_tar', 'a').close()
786+
# Add marker file changes to the rpm folder
787+
execute_command('git add .write_tar ' + rpm_dir)
786788
# Commit changes
787789
execute_command('git commit -m "Generated RPM files for ' +
788790
rpm_distro + '"')

0 commit comments

Comments
 (0)