Skip to content

Commit 9ad8441

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 9ad8441

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cmd-diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ 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']
149-
runcmd(['rpm-ostree', 'db', 'diff', '--repo', TMP_REPO, commit_from, commit_to])
147+
ref_from = diff_from.id
148+
ref_to = diff_to.id
149+
runcmd(['rpm-ostree', 'db', 'diff', '--repo', TMP_REPO, ref_from, ref_to])
150150

151151

152152
def diff_ostree_ls(diff_from, diff_to):
@@ -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)