Skip to content

Commit f8cdd2d

Browse files
committed
cmd-diff: fix rpm diffing in a build-with-buildah world
In the build-with-buildah world there is no ostree-commit-object so there is no lightweight (i.e. partial import) way to do a db diff. We have to do a full import here unless we somehow start storing RPM NEVRAs in a label or annotation. Also, we need to pass the version (id) to `db diff` because the commit checksum in the metadata doesn't seem to work when diffing a build-with-buildah image.
1 parent cb3ea70 commit f8cdd2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cmd-diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ def diff_source_control(diff_from, diff_to):
144144

145145

146146
def diff_rpms(diff_from, diff_to):
147-
commit_from = diff_from.meta['ostree-commit']
148-
commit_to = diff_to.meta['ostree-commit']
147+
commit_from = diff_from.id
148+
commit_to = diff_to.id
149149
runcmd(['rpm-ostree', 'db', 'diff', '--repo', TMP_REPO, commit_from, commit_to])
150150

151151

@@ -428,7 +428,7 @@ def cache_dir(dir):
428428

429429
# unfortunately, this has to come at the end to resolve functions
430430
DIFFERS = [
431-
Differ("rpms", "Diff RPMs", needs_ostree=OSTreeImport.PARTIAL, function=diff_rpms),
431+
Differ("rpms", "Diff RPMs", needs_ostree=OSTreeImport.FULL, function=diff_rpms),
432432
Differ("source-control", "Diff config and COSA input commits",
433433
needs_ostree=OSTreeImport.NO, function=diff_source_control),
434434
Differ("ostree-ls", "Diff OSTree contents using 'ostree diff'",

0 commit comments

Comments
 (0)