Skip to content

Make sure we’re able to fetch files we’re about to retain

Andrej Shadura requested to merge make-retain-work into master

This is a hack.

OBS tracks metadata and package data separately. Separate revlogs and separate trees. When we create a checkout with meta=True, osc will only request metadata part of the package.

This is good for us, since it allows us to start with a mostly clean working directory and still proceed without downloading all of the current contents only to possibly remove it in the first step.

However, this also means that we cannot request contents of the latest package tree if we want to retain some files.

osc used to allow downloading files for package checkouts with meta=True, but it no longer does:

$ osc dput "$PROJECT" _build/*.dsc | tee upload.log
A    _meta
At revision 1.
retaining non-source file: 'apertis-update-manager_0.2019~pre.1_amd64.buildinfo'
fetching 'apertis-update-manager_0.2019~pre.1_amd64.buildinfo' from server
Server returned an error: HTTP Error 404: Not Found
revision '8' does not exist

An alternative hack is to create a checkout with meta=False, set the max. download size to 1 byte, check out the latest revision and mark all existing files for deletion.

Or we can flip the meta flag back to False after we’re done checking out and manually rewind the current revision to the latest one.

cc @em, @smcv.

Merge request reports