After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700731 - Fix --in-[checkout|build]dir when passing no args to the `run' command
Fix --in-[checkout|build]dir when passing no args to the `run' command
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2013-05-20 16:28 UTC by Emanuele Aina
Modified: 2013-07-10 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix --in-[checkout|build]dir when passing no args to the `run' command (1.66 KB, patch)
2013-05-20 16:28 UTC, Emanuele Aina
committed Details | Review
Fix --in-[checkout|build]dir when passing no args to the `run' command (1.66 KB, patch)
2013-07-10 14:23 UTC, Emanuele Aina
committed Details | Review

Description Emanuele Aina 2013-05-20 16:28:00 UTC
The internal module list generation fails if no argument is being passed to
the `run' command:

$ jhbuild run --in-checkoutdir=glib
Traceback (most recent call last):
  • File "/home/em/.local/bin/jhbuild", line 32 in <module>
    jhbuild.main.main(sys.argv[1:])
  • File "/home/em/.local/lib/python2.7/site-packages/jhbuild/commands/__init__.py", line 183 in run
    return cmd.execute(config, args, help)
  • File "/home/em/.local/lib/python2.7/site-packages/jhbuild/commands/base.py", line 369 in execute
    return self.run(config, options, args)
  • File "/home/em/.local/lib/python2.7/site-packages/jhbuild/commands/base.py", line 403 in run
    checkoutdir = module_list[0].get_srcdir(build)
IndexError: list index out of range

Comment 1 Emanuele Aina 2013-05-20 16:28:03 UTC
Created attachment 244833 [details] [review]
Fix --in-[checkout|build]dir when passing no args to the `run' command

Fix `jhbuild run --in-checkoutdir=glib' and let it fail properly instead
of raising an exception.
Comment 2 Colin Walters 2013-07-10 11:42:44 UTC
Review of attachment 244833 [details] [review]:

The code here is...very strange.  The original code, not your new code.  We're not even referencing "modname" in the list comprehension.  It'd be clearer if it was:

module = module_set.get_module(...)
build = get_buildscript(config, [module], module_set=module_set)

Anyways though this looks fine.
Comment 3 Emanuele Aina 2013-07-10 14:22:53 UTC
The following fix has been pushed:
12b85ab Fix --in-[checkout|build]dir when passing no args to the `run' command
Comment 4 Emanuele Aina 2013-07-10 14:23:06 UTC
Created attachment 248836 [details] [review]
Fix --in-[checkout|build]dir when passing no args to the `run' command

Fix `jhbuild run --in-checkoutdir=glib' and let it fail properly instead
of raising an exception.
Comment 5 Emanuele Aina 2013-07-10 15:00:01 UTC
Thanks Colin!

I've applied the change you suggested in bug #703954, taking the chance to deduplicate a bit the handling of the --in-builddir and --in-checkoutdir options. If you have a few moments to review that it would be appreciated. :D