Re: Bug#487437: Please include /etc/dpkg/origins/{debian,default}
Sorry for not answering this before. Is this something that you would
like to see implemented in lenny?
On Sat, 21 Jun 2008, Raphael Hertzog wrote:
> Package: base-files
> Version: 4.0.4
> Severity: wishlist
>
> Please include /etc/dpkg/origins/debian and a symlink
> /etc/dpkg/origins/default -> debian in the base-files package.
>
> The idea is that this symlink should let us detect the vendor of the
> currently installed system. This facility will be used in dpkg to
> offer customized build of Debian packages depending on the current system.
> That way a single source could be shared betwen Debian and the derivatives
> distributions that collaborate with the Debian maintainer (even when some
> differences are needed).
> See http://git.debian.org/?p=dpkg/dpkg.git;a=commitdiff;h=322153b6e8cbe50724f85678f46be5193a751a12
> and http://bugs.debian.org/457371 for this precise use case.
>
> We could keep those files in dpkg but we think it's best if they are part
> of base-files since base-files is a package that any derivative has to
> modify anyway and is also less complex than dpkg.
>
> When you do that, please add a "Replaces: dpkg (<< 1.15)".
I understand the idea behind this, but I'm not fully convinced that it
has to be part of base-files.
Clearly, dpkg is a complex package, but if the only modification a derivative
distribution wants to make is the origins thing, forking is easy enough.
However, I can understand that convenience is a good thing, and that
forking base-files is a lot easier than forking dpkg (if only because
of the build time).
> You should aim to make it easy to drop a supplementary file in that
> directory and update the symlink. So make sure the build system
> automatically includes all files from the directory where you'll put the
> files in the source tarball.
You mean something like this in debian/rules, right?
mkdir -p debian/tmp/etc/dpkg/origins
cp -a origins/* debian/tmp/etc/dpkg/origins
(That would copy whatever is in "origins" directory).
I don't understand the part about "making easy to update the symlink".
I can think of two ways of doing that.
The bad one, to be put in debian/rules:
ln -s debian debian/tmp/etc/dpkg/origins/default
That would be bad because it would be a hardcoded thing, and /etc is
supposed to be under the control of the system admin. While it
would be discouraged that a user change the symlink, I can imagine
a user who wants to upgrade from a derived distribution to a later
pure-debian distribution, or viceversa, if they do not differ too much.
A better way to handle the symlink would be to make it in the postinst,
exactly once, the very first time base-files is installed by
debootstrap, i.e. inside the block starting with this line:
if [ "$1" = "configure" ] && [ "$2" = "" ]; then
which is already full of things to be done only once at the initial install.
I think this would be easy enough to fork, and it would also allow the user
to change it.
To summarize, the required changes would be:
* A new "origins" directory in the source code.
* The "debian" file inside such directory.
* Two lines in debian/rules to copy the files into debian/tmp
* A line in the postinst to set the default symlink.
Would you be happy with this?
Reply to: