Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add --only [pkg_1] [pkg_2] ... [pkg_n] #109

Merged
merged 2 commits into from
Dec 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions superflore/generators/bitbake/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
import sys

from rosinstall_generator.distro import get_distro
from superflore.CacheManager import CacheManager
from superflore.generate_installers import generate_installers
from superflore.generators.bitbake.gen_packages import regenerate_installer
Expand Down Expand Up @@ -68,6 +69,11 @@ def main():
help='location to store archived packages',
type=str
)
parser.add_argument(
'--only',
nargs='+',
help='generate only the specified packages'
)
selected_targets = active_distros
args = parser.parse_args(sys.argv[1:])
if args.all:
Expand Down Expand Up @@ -97,6 +103,32 @@ def main():
with TempfileManager(args.tar_archive_dir) as tar_dir,\
CacheManager(sha256_filename) as sha256_cache,\
CacheManager(md5_filename) as md5_cache: # noqa
if args.only:
for pkg in args.only:
info("Regenerating package '%s'..." % pkg)
try:
regenerate_installer(
overlay,
pkg,
get_distro(args.ros_distro),
preserve_existing,
tar_dir,
md5_cache,
sha256_cache
)
except KeyError:
err("No package to satisfy key '%s'" % pkg)
sys.exit(1)
# Commit changes and file pull request
regen_dict = dict()
regen_dict[args.ros_distro] = args.only
overlay.regenerate_manifests(regen_dict)
overlay.commit_changes(args.ros_distro)
delta = "Regenerated: '%s'\n" % args.only
file_pr(overlay, delta, '')
ok('Successfully synchronized repositories!')
sys.exit(0)

for distro in selected_targets:
distro_installers, distro_broken, distro_changes =\
generate_installers(
Expand Down
16 changes: 10 additions & 6 deletions superflore/generators/ebuild/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,16 @@ def main():
if args.only:
for pkg in args.only:
info("Regenerating package '%s'..." % pkg)
regenerate_pkg(
overlay,
pkg,
get_distro(args.ros_distro),
preserve_existing
)
try:
regenerate_pkg(
overlay,
pkg,
get_distro(args.ros_distro),
preserve_existing
)
except KeyError:
err("No package to satisfy key '%s'" % pkg)
sys.exit(1)
# Commit changes and file pull request
regen_dict = dict()
regen_dict[args.ros_distro] = args.only
Expand Down