~paelzer/curtin/bug-1574113-derived-repositories

Viewing all changes in revision 321.1.1.

  • Committer: Scott Moser
  • Date: 2015-12-17 16:19:56 UTC
  • mto: This revision was merged to the branch mainline in revision 323.
  • Revision ID: smoser@ubuntu.com-20151217161956-mv6lsowh5jwe25tc
fix calling curtin --help

The launcher was passing command arguments through to PY3OR2_MCHECK.
If you ran './curtin --help', then the launcher would call:
  python3 -m $PY3OR2_MCHECK --help
That program would print its help, and exit 0.
The launcher would interpret the exit status of 0 to mean all dependencies
were met.  If that was not the case, then it would not look further to
test python.

In an environment (trusty) where python2 had deps installed, but python3
did not, the launcher would then invoke 'curtin --help' with python3.
That would then stacktrace on missing dependencies.

The fix here is to pass '--' to separate the arguments to the checker
from the arguments that would be used.

In order to facilitate debugging, if PY3OR2_DEBUG is present, then
we will add '-v' to the invocation, calling:
  python3 -m $PY3OR2_MCHECK -v -- args...

The result is then that:
  PY3OR2_DEBUG=1 ./bin/curtin --help

Will show output like:
  python3 [94]: Fix with:
    apt-get -qy install bcache-tools btrfs-tools lvm2 mdadm python3-oauthlib xfsprogs
  current best: python3
  python [94]: Fix with:
    apt-get -qy install bcache-tools btrfs-tools lvm2 mdadm python-oauthlib xfsprogs
  executing: python3 -m "curtin.commands.main" --help

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: