Quoting Dima Kogan (2023-03-28 23:27:55)
> I have never once in my life ran sbuild from a .dsc file. In fact I don't
> think I've ever done anything with .dsc files directly. I'm always sitting on
> the sources, with a ../whatever.orig.tar.gz on disk.

Yes, since most people want to use it like that, the convenience wrapper was
added. That way, you do not have to manually build the .dsc before calling
sbuild. But building the .dsc is mandatory one way or another because that's
the input for sbuild. It's how the source package is transferred into the
chroot.

> If I've been using it wrong this whole time, I guess that's on me. But
> starting from sources feels like the natural flow to me, so can we make this
> work a bit better?

You have not been using it wrongly. And you are not clear in your terminology.
The source is the .dsc. You could also call the unpacked .dsc source but the
disadvantage of that kind of source is, that in contrast to the .dsc, the
unpacked source can be tainted and thus has to be cleaned first.

I don't think you've been doing anything wrong. You've just taken advantage of
a convenience feature sbuild offers to be able to run from within an unpacked
source package.

> If we wanted to make the clean step optional, sbuild can check for source
> differences, and barf if any are detected. It mostly does that already.

No it does not. Maybe what you observed is, that dpkg dies if it finds
unexpected changes but sbuild does no such checks.

> I believe it doesn't complain if there are extra files on disk, but we could
> make it do that too.

That's dpkg complaining, not sbuild.

I fear I do not quite understand what kind of feature you are asking for. Do
you really think it would be a good idea if sbuild, every time you run it,
first locates a .dsc, unpacks the .dsc, compares the unpacked .dsc to your
current directory and only invokes the clean target if it finds differences?
Would there not almost always be differences because you only invoke sbuild
*after* you've made some changes to the unpacked source directory? And what
should sbuild do if it has detected changes? It would still need to run the
clean target before it can create the new source package.

> Other than that, can we run "dh clean" inside the chroot?

What would that accomplish? At the point where the .dsc is unpacked inside the
chroot, it already is clean. You need a clean unpacked source directory, so
that you can build a .dsc so that it can be copied into the chroot. So this
cleaning has to happen on the outside.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to