Comment 1 for bug 433454

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 433454] [NEW] Allow multiple dput destinations

On Sun Sep 20 10:59:26 UTC 2009 Neil J. Patel wrote:
> Public bug reported:
>
> It would be most useful to be able to run something like:
>
> bzr dailydeb clutter.recipe --key-id FFFFFFFF --dput ppa:njpatel
> /clutter-edgers;ppa:netbook-remix-team/ppa
>
> So the dailydeb command only needs to run once, but we can send the
> source package to more than one destination.

Hi Neil,

Thanks for the bug report.

I think this would be reasonable.

The way I think this should be done is: in __init__.py

Change

   Option("dput", ...

to

   ListOption("dput", ...

This will mean that --dput can be given multiple times, with
each argument being appended to a list, so in your case
it would be

   bzr dailydeb clutter.recipe --key-id FFFFFFFF \
        --dput ppa:njpatel/clutter-edgers \
        --dput ppa:netbook-remix-team/ppa

which I think is slightly cleaner and avoids too much parsing
(I'm also not sure if ";" is a valid character in a dput target).

Then,

alter the help text for that option to state that it can be used
multiple times to upload to multiple places.

Then,

    if dput is not None:
        self._dput_source_package(package_dir, dput)

becomes

    if dput is not None:
        for target in dput:
            self._dput_source_package(package_dir, target)

And it should work in some cases.

I can think of two issues:

    1) If you specify 2 PPAs, then I think that dput will complain
       that you have already uploaded to ppa.launchpad.net for the
       second one. I think the way to solve this might be to
       always call dput with "-f", I'm not sure we want its
       protection.

    2) Some people might want different signatures for different
       targets. I'm happy to say that they should just run two
       commands if this is the case, but if we can support it
       elegantly we should. I know that .changes can only have
       one signature, so you would need to say which sig
       is required for which target, with re-signing between.

       The way that pops in to my mind is

       --key-id 0xFFFFFFFF --dput target1
       --key-id 0xEEEEEEEE --dput target2

       with no-resigning done when the list of keys is shorter than
       the lists of target.

I would merge a branch that used -f for dput and ignored the signing
thing for now. I would also work on this myself if no one beat
me to it.

Thanks,

James