Skip to content

Commit b3054cc

Browse files
dustymabejlebon
authored andcommitted
cmd-import: consider architecture when calculating previous build
Not all architectures get built for every build in a stream. This is true at least for non-production streams. Let's account for that here.
1 parent ee19d83 commit b3054cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cmd-import

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def main():
3939

4040
builds = Builds()
4141
arch = get_basearch()
42+
previous_build = builds.get_latest_for_arch(arch)
4243
if builds.has(buildid) and arch in builds.get_build_arches(buildid):
4344
print(f"ERROR: Build ID {buildid} ({arch}) already exists!")
4445
sys.exit(1)
@@ -68,8 +69,8 @@ def main():
6869
# right places) let's use `cosa diff` to insert package and
6970
# advisory diffs into the meta.json and log the RPM diff, but
7071
# only if we have something to diff against.
71-
if args.parent_build or len(builds.get_builds()) > 1:
72-
starting_buildid = args.parent_build if args.parent_build else builds.get_previous()
72+
if args.parent_build or previous_build:
73+
starting_buildid = args.parent_build if args.parent_build else previous_build
7374
calculate_and_log_diffs(builds, buildid, arch, starting_buildid)
7475

7576
if not args.skip_prune:

0 commit comments

Comments
 (0)