Re: on the use of chmod/chown in maintainer scripts
Carsten Hey <carsten@debian.org> writes:
> * Andreas Barth [2012-05-13 11:06 +0200]:
>> * Russ Allbery (rra@debian.org) [120512 23:06]:
>>> Usually because the UID is dynamically assigned and the user is
>>> created in the postinst, so there's no way for dpkg do do this at
>>> unpack.
>>> You would need to apply permissions by name, not UID/GID, and you
>>> would need to create all users in preinst prior to unpack, which would
>>> require Pre-Depends on adduser with all the complexity that entails.
>>> I haven't thought through that path to see if there are any other
>>> problems.
>> Wouldn't it be sensible to describe which user(s) a programm needs as
>> well not by "adduser $user" but in a more abstract syntax
> I agree.
You certainly don't have to convince me of that. :) *The* biggest thing
that I wish I had time to do for Debian and don't is to write a high-level
declarative language that would implement 80% of the current tasks of
maintainer scripts and allow shell fragments duplicated in N packages
(admittedly often generated by debhelper and therefore consistent and of
high quality, but still requiring a rebuild to change in the rare case of
a bug or requirements change in the debhelper behavior) with a declarative
statement processed by one tool that can patched and updated as needed.
There's a lot less than there used to be thanks to triggers, but still I
bet 80-90% of the maintainer scripts in Debian could be eliminated in
favor of a much simpler, pluggable system.
>> and let dpkg handle all of that?
> This doesn't look like a task that should be done by dpkg itself;
> instead debhelper or dpkg-maintscript-helper could be used.
Agreed. Putting it directly in the dpkg C code doesn't seem like a good
separation of tasks, although it needs to be closely coordinated so that
we can use the dpkg unpack stage to set ownership.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: