Skip to content

Commit 41c6b42

Browse files
nikita-dubrovskiijlebon
authored andcommitted
cmd-diff: support passing in the architecture
This adds '--arch' argument to pass architecture you want to get information about. By default current arch is used. ``` $ uname -m x86_64 $ cosa diff --arch=s390x --from=41.20250101.20.0 --to=41.20250114.20.0 --rpms ostree diff commit from: c3fe29653cf0ebd1d093b1a55cf9ac79a386373e71f64c67769f904332ba0ca6 ostree diff commit to: 988aa49471f406354274bc013c1102004dad25000862df68472d6058fcb00f8b Upgraded: audit 4.0.2-1.fc41 -> 4.0.3-1.fc41 audit-libs 4.0.2-1.fc41 -> 4.0.3-1.fc41 ... ``` Issue: #3987
1 parent 09868d1 commit 41c6b42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/cmd-diff

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class DiffBuildTarget:
2222
meta: dict
2323

2424
@staticmethod
25-
def from_build(builds, build):
26-
return DiffBuildTarget(build, builds.get_build_dir(build),
27-
builds.get_build_meta(build))
25+
def from_build(builds, build, arch):
26+
return DiffBuildTarget(build, builds.get_build_dir(build, arch),
27+
builds.get_build_meta(build, arch))
2828

2929

3030
@dataclass
@@ -66,8 +66,8 @@ def main():
6666
if args.diff_from == args.diff_to:
6767
raise Exception("from and to builds are the same")
6868

69-
diff_from = DiffBuildTarget.from_build(builds, args.diff_from)
70-
diff_to = DiffBuildTarget.from_build(builds, args.diff_to)
69+
diff_from = DiffBuildTarget.from_build(builds, args.diff_from, args.arch)
70+
diff_to = DiffBuildTarget.from_build(builds, args.diff_to, args.arch)
7171

7272
# get activated differs
7373
active_differs = []
@@ -96,6 +96,8 @@ def parse_args():
9696
parser.add_argument("--from", dest='diff_from', help="First build ID")
9797
parser.add_argument("--to", dest='diff_to', help="Second build ID")
9898
parser.add_argument("--gc", action='store_true', help="Delete cached diff content")
99+
parser.add_argument("--arch", dest='arch', help="Architecture of builds")
100+
99101
for differ in DIFFERS:
100102
parser.add_argument("--" + differ.name, action='store_true', default=False,
101103
help=differ.description)

0 commit comments

Comments
 (0)