Skip to content

Commit

Permalink
Create changes file if none exists
Browse files Browse the repository at this point in the history
This was noticed in a CI generated package with only a _service file,
which now fails because I made rpm error when it finds no changes file
in Factory.

Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1220540
  • Loading branch information
JanZerebecki committed Feb 28, 2024
1 parent 9df35c1 commit 1d47166
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions TarSCM/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ def _process_changes(self, args, ver, changesversion, detected_changes):
changesversion = self.get_version()

logging.debug("Searching for '*.changes' in %s", os.getcwd())
changesfiles = glob.glob('*.changes')
if not changesfiles:
if args.filename:
basename = args.filename
else:
basename = os.path.basename(self.scm_object.clone_dir)
changesfiles = [basename + ".changes"]
for filename in glob.glob('*.changes'):
new_changes_file = os.path.join(args.outdir, filename)
shutil.copy(filename, new_changes_file)
Expand Down

0 comments on commit 1d47166

Please sign in to comment.