Bzr lightweight checkouts?


#1

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


#2

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?


#3

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)


#4

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 \
        .