Pregunta

I have a number of common functions that I would like to source, so it's available in the debian maintainer scripts (preinst/postinst/prerm/postrm), call it common.sh.

If I add "common.sh" to the DEBIAN directory, dpkg complains:

dpkg-deb: warning: conffile '' is not a plain file
dpkg-deb: warning: ignoring 1 warning about the control file(s)

However, the package builds properly.

When I install, it's difficult to find the proper directory where my common.sh exists. In preinst it seems to be looking for /var/lib/dpkg/tmp.ci, while in postinst it seems to look for /var/lib/dpkg/info.

I could stick the common.sh in a tmp directory and delete it later, but I get the feeling that files installed to the OS should remain their until dpkg can remove them.

At any rate, I'm wondering what the true 'debian' way of doing this would be?

¿Fue útil?

Solución

The preinst is run from some implementation defined directory because the package isn't unpacked into its proper location in the filesystem yet.

I'm pretty sure forcing extra files into the DEBIAN part is not allowed for standard packages. You could install common.sh into the filesystem, usually under /usr/share/yourpackagename/, and the use it from the postinst and prerm scripts.

It doesn't work for preinst and postrm as the package contents are not available then.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top