Bzr lightweight checkouts?


Is there anyway to tell snapcraft to do a lightweight checkout when using bzr source type?


Currently that’s no supported. I imagine source-depth: 0 could be allowed for a bzr source to mean co --leightweight and error out with any other value since there’s no way to get only a part of the tree.
Alternatively we could introduce a new property like lightweight, which then raises the question of how that would translate to other sources…

I’m slightly concerned that this may cause non-obvious problems during the build. For example source-depth won’t actually work correctly with all git repositories and can break your build, which is why by default you get a full checkout.
In the case of --lightweight I don’t know how much it affects behavior, although I’m guessing the build could become slower due to having to query the network during the build?


its an ugly hack but you could use a “prepare:” scriptlet i guess with the full bzr commandline you want (and leave source: bzr out)


An example based on override-pull scriptlet, just if anyone needed:

    source: lp:audio-recorder
    override-pull: |
      set -eu

      bzr checkout \
        --lightweight \
        lp:audio-recorder \