Skip to content

Commit

Permalink
Fix #229 (#257)
Browse files Browse the repository at this point in the history
* Only commit packages that were generated successfully with the `only` option

Signed-off-by: Hunter L. Allen <[email protected]>

* Change to set instead of list, as well as fix appending of packages

Signed-off-by: Hunter L. Allen <[email protected]>

* Update to new API for regenerate_pkg

Signed-off-by: Hunter L. Allen <[email protected]>
  • Loading branch information
allenh1 authored Dec 17, 2019
1 parent 222ceba commit 412f7b2
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions superflore/generators/ebuild/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,34 +116,55 @@ def main():
overlay.repo.get_last_hash()
)
)
missing_depends = set()
to_commit = set()
will_file_pr = False
for pkg in args.only:
if pkg in skip_keys:
warn("Package '%s' is in skip-keys list, skipping..."
% pkg)
continue
info("Regenerating package '%s'..." % pkg)
try:
regenerate_pkg(
ebuild, deps, version = regenerate_pkg(
overlay,
pkg,
get_distro(args.ros_distro),
preserve_existing
)
if not ebuild:
for dep in deps:
missing_depends.add(dep)
except KeyError:
err("No package to satisfy key '%s'" % pkg)
sys.exit(1)
continue
if ebuild:
to_commit.add(pkg)
will_file_pr = True
# if no packages succeeded, exit with error
if not will_file_pr:
err("No packages generated successfully, exiting.")
sys.exit(1)
# Commit changes and file pull request
regen_dict = dict()
regen_dict[args.ros_distro] = args.only
regen_dict[args.ros_distro] = to_commit
overlay.regenerate_manifests(regen_dict)
overlay.commit_changes(args.ros_distro)
if args.dry_run:
save_pr(
overlay, args.only, missing_deps=None, comment=pr_comment
overlay,
args.only,
missing_deps=gen_missing_deps_msg(missing_depends),
comment=pr_comment
)
sys.exit(0)
delta = "Regenerated: '%s'\n" % args.only
file_pr(overlay, delta, '', pr_comment)
file_pr(
overlay,
delta,
gen_missing_deps_msg(missing_depends),
pr_comment
)
ok('Successfully synchronized repositories!')
sys.exit(0)

Expand Down

0 comments on commit 412f7b2

Please sign in to comment.