#870102 automatically update schroots

Package:
sbuild
Source:
sbuild
Submitter:
Antoine Beaupre
Date:
2025-04-16 06:30:02 UTC
Severity:
wishlist
Tags:
#870102#5
Date:
2017-07-29 20:15:29 UTC
From:
To:
It would be nice if sbuild automatically updated the configured
schroots. As things stand now, a configured schroot will slowly rot
down to a point where new builds will have to download a bunch of base
packages at each run, if sbuild is configured to automatically update
the schroot at build time. And if it's not, the resulting build will
be based on bit-rotten code as well.

I have used the following simple script in /etc/cron.weekly/sbuild:

#!/bin/sh -e

cd /etc/sbuild/chroot/
for chroot in *; do
    sbuild-update --update --upgrade --clean --autoclean --autoremove $chroot >/dev/null
done

I don't like it so much: "> /dev/null" is a crude hack, and it should
be possible to silence apt more carefully. But it works and is good
enough for my purpose.

Could that be considered upstream?

Thanks!

A.

#870102#8
Date:
2017-07-30 06:31:08 UTC
From:
To:
Quoting Antoine Beaupre (2017-07-29 22:15:29)

Do you not find the script in /usr/share/doc/sbuild/examples/sbuild-update-all
sufficient?

#870102#13
Date:
2017-07-30 14:05:08 UTC
From:
To:
s/sufficient// :) I didn't notice that one at all.

How about hooking it straight into cron in some way, or documenting it
somewhere?

Maybe all I need to do is to hook that in the sbuild wiki page?

a.

#870102#16
Date:
2017-07-30 14:06:29 UTC
From:
To:
Quoting Antoine Beaupré (2017-07-30 16:05:08)

Patches welcome!

Sure. :)

#870102#21
Date:
2017-07-30 14:26:08 UTC
From:
To:
For documenting or for cron?

In fact, how about just installing the script in /usr/sbin?

Cool.

A.

#870102#24
Date:
2017-07-30 14:30:23 UTC
From:
To:
Quoting Antoine Beaupré (2017-07-30 16:26:08)

For documenting. The cron script already exists. ;)

It even has documentation of how to use it at the top. What's missing is to
somehow tell people that the script exists.

Since it's not made to be used like a normal script (controlled via environment
variables and redirections for logging) I don't think that would be a good
idea.

#870102#29
Date:
2017-07-30 14:42:29 UTC
From:
To:
I mean in /etc/cron.weekly for example.

Okay, so where can we do this - i suggested the wiki as a starting
point, but I guess adding it to the README file would be good as well?

It seems to have sane enough defaults that this shouldn't matter. I
don't see why that would be a problem anyways.

Another advantage in having it in the PATH somewhere is that it could
then have a manpage and be cross-referenced from stuff like
sbuild-update... Autocompletion also does wonder for auto-discovery...

Thanks!

#870102#32
Date:
2017-07-30 14:47:52 UTC
From:
To:
Quoting Antoine Beaupré (2017-07-30 16:42:29)

But putting it there would enable it by default which I'd like to avoid.

README.Debian would be a good place to reference that script.

The wiki is a nice-to-have. All documentation should be inside the package
itself. The wiki should only be a nice extra.

I see the utility of having a script that just does the right thing. Especially
because I guess that most people just run sbuild-update with the same options
(-udcar) all the time anyways.

But schroot is only the default chroot backend of sbuild. If we implement a
method with as much visibility as putting into PATH now, then it should be
future proof to also allow updating other sbuild backends.

sbuild-update could (and probably should) still reference to it even when it
stays in /usr/share/doc

#870102#37
Date:
2017-07-30 15:44:38 UTC
From:
To:
ack.

hmm... there's really a ton of stuff in the wiki that's missing from the
package. how about we merge those somehow?

Yep, that's what I found out as well. :)

... well that's what the BUGS section is for, isn't it? ;)

true.

a.