Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions autospec/autospec.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ def package(args, url, name, archives, workingdir):
# specfile template is assumed "correct" and any failures need to be manually addressed
break
filemanager.load_specfile(specfile)
if 'license' in specfile.packages and not conf.config_opts['has_license']:
conf.config_opts['has_license'] = True
conf.rewrite_config_opts()
specfile.write_spec()
filemanager.newfiles_printed = 0
mock_chroot = "/var/lib/mock/clear-{}/root/builddir/build/BUILDROOT/" \
Expand All @@ -297,6 +300,10 @@ def package(args, url, name, archives, workingdir):
conf.create_buildreq_cache(content.version, requirements.buildreqs_cache)
print_build_failed()
sys.exit(1)
elif 'license' not in specfile.packages and conf.config_opts['has_license']:
print_fatal("package -license subpackage deleted")
conf.create_buildreq_cache(content.version, requirements.buildreqs_cache)
sys.exit(1)
elif os.path.isfile("README.clear"):
try:
print("\nREADME.clear CONTENTS")
Expand Down
1 change: 1 addition & 0 deletions autospec/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def __init__(self, download_path):
"no_glob": "Do not use the replacement pattern for file matching",
"allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged",
"use_ninja": "Use ninja build files",
"has_license": "Require license subpackage for successful build",
}
# simple_pattern_pkgconfig patterns
# contains patterns for parsing build.log for missing dependencies
Expand Down