-
Notifications
You must be signed in to change notification settings - Fork 34
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
option
#76
Conversation
@tfoote I'm working on this right now before I look into more unit tests and making the yocto stuff better in an effort to reduce the duplicate sections of code. My line of thought here is to make a I think this would also make things better in the future for extending things, and I can't figure out what went wrong in my head wherein I didn't write it this way the first time. Does this sound like a good step to you? |
26f99eb
to
7fadbca
Compare
Rebased on top of #77 |
f9ee362
to
5b9bac0
Compare
0755800
to
eca4561
Compare
…handle missing dependencies.
…ages with changes.
@tfoote I was going to remove the Open Embedded dependency with this PR, then I noticed how many commits in I was. I'll adapt there after this one, I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put in a few suggestions on how to cleaup/improve. Deferring the open embedded separation seems like a good decision.
superflore/generate_installers.py
Outdated
results = 'Generated {0} / {1}'.format(succeeded, failed + succeeded) | ||
results += ' for distro {0}'.format(distro_name) | ||
info("------ {0} ------".format(results)) | ||
print() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird to use print in addition to the logging functions. Maybe just add a newline to the above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, that's definitely true. I might just remove it all together.
superflore/generate_installers.py
Outdated
distro_name, # ros distro name | ||
overlay, # repo instance | ||
gen_pkg_func, # function to call for generating | ||
update=True # are we in update mode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does update mean here? I thought it was forcing an update but https://github.com/ros-infrastructure/superflore/pull/76/files#diff-22c1a4ad79cb71ae0b51b9ef9621bf80R60 doesn't make sense in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, update
gets set to True
to keep the ebuilds that are currently there (so quite the opposite). I'll change it back to preserve_existing
, which it was previously.
|
||
|
||
def make_dir(dirname): | ||
def regenerate_pkg(overlay, pkg, distro_name=None, distro=None, update=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need both distro and distro_name support? That seems like it is just going to be more to test. Since it's only a one line command to get the distro. It would be better to do that from the calling instance and not have the ambiguous API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's only a one line command to get the distro. It would be better to do that from the calling instance and not have the ambiguous API.
Ya, that's true. I was going for an optimization here, but I don't think I really saved myself anything.
superflore/generators/ebuild/run.py
Outdated
parser.add_argument( | ||
'--only', | ||
help='generate only the specified package', | ||
type=str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend supporting mutiple listed packages. You can use nargs='+'
https://docs.python.org/3/library/argparse.html#nargs
Note you'll slightly need to change the logic https://github.com/ros-infrastructure/superflore/pull/76/files#diff-5a7657ae13022a44815efc96706d2233R147 to iterate over the multiple arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering how one would go about this. ;) Thanks for the resources. I'll definitely add this in.
f1726cf
to
cd2ddc8
Compare
cd2ddc8
to
b707825
Compare
@tfoote Ok, ready for round two. |
* Creating an option to only regenerate a specified package. * Regeneration of a single package is now working. Next is refactoring. * Add unused installer list from regenerate function. * Unify printing functions * Forgot one of the print calls, and moved a variable accidently. * Added util print functions to run.py. * Make the exception handling for make_dir more strict. * Linting after rebase. * Removing duplicated logic from gen_packages function * Moved generate installers function to its own file, outside of the gentoo directory. * Remove all gentoo specific logic from gen_packages, and add logic to handle missing dependencies. * Fixed issue with unresolved dependencies not being reported. * Modify regenerate package logic to only regenerate manifests for packages with changes. * Fix regen logic for a single package. * Addresses comments by @tfoote. * Added nargs='+' to the '--only' option so that multiple packages can be selected.
This set of changes adds an option to generate a single package by name, and will also include a refactor of
generate_packages.py
so that it can be relocated outside theebuild
folder (this will eliminate a lot of redundancy).ToDo:
--only PKG
flag to generate a single packageregenerate_manifests
to only regenerate changed packages