feat: calculate and store changes for each update

This commit is contained in:
2024-09-17 13:34:24 +03:00
parent 9785835c0e
commit a396126a79
6 changed files with 18 additions and 16 deletions

View File

@ -50,10 +50,10 @@ class Update(Handler):
packages = application.updates(args.package, aur=args.aur, local=args.local, manual=args.manual, vcs=args.vcs,
check_files=args.check_files)
if args.dry_run: # some check specific actions
if args.changes: # generate changes if requested
application.changes(packages)
if args.changes: # generate changes if requested
application.changes(packages)
if args.dry_run: # exit from application if no build requested
Update.check_if_empty(args.exit_code, not packages) # status code check
return

View File

@ -79,8 +79,9 @@ class Executor(PackageInfo, Cleaner):
with self.in_event(single.base, EventType.PackageUpdated, failure=EventType.PackageUpdateFailed):
packager = self.packager(packagers, single.base)
last_commit_sha = build_single(single, Path(dir_name), packager.packager_id)
# clear changes and update commit hash
self.reporter.package_changes_update(single.base, Changes(last_commit_sha))
# update commit hash for changes keeping current diff if there is any
changes = self.reporter.package_changes_get(single.base)
self.reporter.package_changes_update(single.base, Changes(last_commit_sha, changes.changes))
# update dependencies list
package_archive = PackageArchive(self.paths.build_root, single, self.pacman, self.scan_paths)
dependencies = package_archive.depends_on()