← Back to team overview

yellow team mailing list archive

lpsetup update and finish command line args

 

Hi all,

I've found in trunk some changes in update and finish-inithost cli
arguments. Right now they both accept *repository* and *checkout_name*,
I think Brad made this change so that the arguments are similar to the
ones used in init-repo, and maybe this simplify how arguments are
handled in install-lxc, and surely other reasons I am not currently
aware of. These changes make sense IMHO, and I am totally ok if we want
to follow this direction. However, I was thinking about the lpsetup UI
and how I'd like to use *update* once lpsetup is released. So, one
proposal follows, that hopefully can be discussed and maybe discarded,
but at the end could lead to an agreement on the lpsetup UI.

*update* does not care if the target dir is a lightweight checkout or a
branch with tree. When using *update*, AFAICT, it's even irrelevant if
that branch is part of a shared repository or just standalone.
UI::

    lp-setup update [target_dir] [-e, --external-path] [--use-http]

target_dir defaults to current dir, so that you can do, e.g.::

   cd mybranch [or cd sandbox]
   lpsetup update

Yesterday I added an handler in my branch::

    def handle_target(namespace):
        """Handle *repository*, *branch_name*, *checkout_name* and
        *no_checkout*.

        These names must be present in the namespace.
        Produces *target_dir*: the real working dir where
        the actual code lives.
        """
        if namespace.no_checkout:
            target_name = namespace.branch_name
        else:
            target_name = namespace.checkout_name
        namespace.target_dir = os.path.join(
            namespace.repository, target_name)

install-lxc (that, since it must run init-repo, accepts *repository*,
*checkout_name*, *branch_name* and *no_checkout*) could use this handler
to pass *target_dir* to update/finish_inithost. This way we can easily
support our parallel testing story, which does not create lightweight
checkouts.

Thoughts?

PS: good news, install-lxc works in my branch (using --use-http
--no-checkout too!): lpsetup exits successfully, *make schema* works.
However, running just *make* produces an error:
    touch /var/tmp/bazaar.launchpad.dev/rewrite.log
    touch: cannot touch `/var/tmp/bazaar.launchpad.dev/rewrite.log':
           Permission denied
/var/tmp/bazaar.launchpad.dev/rewrite.log is owned by root.

PPS: I think install-lxc must stop the container at the end of the
process (should I make a card?).

--
Francesco Banconi