FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 07-16-2011, 02:48 PM
Peter Samuelson
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

[Christopher Baines]
> I would consider the best solution to be a mixture of the two, so the
> symbolic package handles fetching the data, but then tells dpkg what
> files its putting where.

I don't really care that much about huge data packages, but this jumped
out at me. It would be useful in any number of situations to be able
to "register" a file with dpkg: tell dpkg that a given package owns a
given file, so that it is automatically removed when the package is
removed or upgraded. I can see this being used in many postinst
scripts, so as to simplify or eliminate the corresponding postrm.

(It's possible that some people would want to use this capability in
the sense that a package _upgrade_ preserves the file but package
_removal_ removes it. Or even that upgrade and removal both preserve
the file, but purge removes it. So if there are 3 desirable behaviors
for the same basic feature, maybe that's a sign that it is a bad idea
after all.)
--
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110716144811.GE4164@p12n.org">http://lists.debian.org/20110716144811.GE4164@p12n.org
 
Old 07-16-2011, 03:12 PM
Paul Wise
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Sat, Jul 16, 2011 at 4:48 PM, Peter Samuelson wrote:

> It would be useful in any number of situations to be able
> to "register" a file with dpkg: tell dpkg that a given package owns a
> given file, so that it is automatically removed when the package is
> removed or upgraded. *I can see this being used in many postinst
> scripts, so as to simplify or eliminate the corresponding postrm.

I have wanted this for a long time and would use it in
clamav-unofficial-sigs if it were available. I'd want both registering
and unregistering, since clamav-unofficial-sigs might need to remove
some files. It would be used at both runtime and in maintainer
scripts.

> (It's possible that some people would want to use this capability in
> the sense that a package _upgrade_ preserves the file but package
> _removal_ removes it. *Or even that upgrade and removal both preserve
> the file, but purge removes it. *So if there are 3 desirable behaviors
> for the same basic feature, maybe that's a sign that it is a bad idea
> after all.)

I think c-u-s would need files preserved on upgrade but removed on
package removal.

--
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAKTje6HRVw2Bbv1u71zRgE0yf4v9JpeHZOpP92YF4Q-gOUgsCQ@mail.gmail.com">http://lists.debian.org/CAKTje6HRVw2Bbv1u71zRgE0yf4v9JpeHZOpP92YF4Q-gOUgsCQ@mail.gmail.com
 
Old 07-16-2011, 07:32 PM
Christopher Baines
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Sat, 2011-07-16 at 17:12 +0200, Paul Wise wrote:
> On Sat, Jul 16, 2011 at 4:48 PM, Peter Samuelson wrote:
>
> > It would be useful in any number of situations to be able
> > to "register" a file with dpkg: tell dpkg that a given package owns a
> > given file, so that it is automatically removed when the package is
> > removed or upgraded. I can see this being used in many postinst
> > scripts, so as to simplify or eliminate the corresponding postrm.
>
> I have wanted this for a long time and would use it in
> clamav-unofficial-sigs if it were available. I'd want both registering
> and unregistering, since clamav-unofficial-sigs might need to remove
> some files. It would be used at both runtime and in maintainer
> scripts.

So a control file would do for this, I think packages should only be
able to register/unregister files from there own package, packages they
Replace, or files that are do not belong to any package. Otherwise this
feature could be abused.

Chris
 
Old 07-16-2011, 10:22 PM
Roger Leigh
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Sat, Jul 16, 2011 at 08:32:46PM +0100, Christopher Baines wrote:
> On Sat, 2011-07-16 at 17:12 +0200, Paul Wise wrote:
> > On Sat, Jul 16, 2011 at 4:48 PM, Peter Samuelson wrote:
> >
> > > It would be useful in any number of situations to be able
> > > to "register" a file with dpkg: tell dpkg that a given package owns a
> > > given file, so that it is automatically removed when the package is
> > > removed or upgraded. I can see this being used in many postinst
> > > scripts, so as to simplify or eliminate the corresponding postrm.
> >
> > I have wanted this for a long time and would use it in
> > clamav-unofficial-sigs if it were available. I'd want both registering
> > and unregistering, since clamav-unofficial-sigs might need to remove
> > some files. It would be used at both runtime and in maintainer
> > scripts.
>
> So a control file would do for this, I think packages should only be
> able to register/unregister files from there own package, packages they
> Replace, or files that are do not belong to any package. Otherwise this
> feature could be abused.

If you have a control file, then this feature is not needed. Before
a file is registered, it doesn't belong to any package, so I'm not
sure what your point is there.

This concept fills a gap which the current facilities do not cater
for. It could be abused of course, but that's not really a reason
not to provide it. All our tools can be used incorrectly in the
wrong hands.

If my package e.g. generates some files in its postinst, these won't
belong to the package manifest. This means I'll have to remember to
remove them in the postrm. But this is really error prone and
dangerous: I might stop generating it in a future version, but I
still need to retain the logic. It might be provided by another
package, which could cause the postrm to break unrelated software.
By registering the file as I create it, I completely avoid the
breakage potential of complex and poorly-tested postrm logic--it's
completely removed. It also means that other packages can't
arbitrarily overwrite it. It would certainly be very useful for
e.g. generated files in /var which currently require special
handling in postrm.

Obvious this could cause problems if not coordinated between packages,
but it certainly serves a needed purpose and has the potential to
improve our maintainer scripts greatly.


Regards,
Roger

--
.'`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
 
Old 07-16-2011, 11:04 PM
Peter Samuelson
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

[Roger Leigh]
> By registering the file as I create it, I completely avoid the
> breakage potential of complex and poorly-tested postrm logic--it's
> completely removed. It also means that other packages can't
> arbitrarily overwrite it. It would certainly be very useful for
> e.g. generated files in /var which currently require special handling
> in postrm.

Before seriously proposing this as a core feature in dpkg, we really do
need to figure out which of the 3 behaviors are needed:

- Treat the file as though it were shipped in the package directly.
This means it is removed on package upgrade, as well as on package
removal. This is very straightforward (append the filename to
/var/lib/dpkg/info/{foo}.list), but perhaps not too useful.

- Do not remove the file on package upgrade, but do remove it when
removing the package.

- Only remove the file on package purge. Call it the ucf use case.

I'm just laying out the options, I don't know whether one, two, or all
three options would be sensible.
--
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110716230456.GF4164@p12n.org">http://lists.debian.org/20110716230456.GF4164@p12n.org
 
Old 07-18-2011, 12:19 PM
Paul Wise
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Sun, Jul 17, 2011 at 1:04 AM, Peter Samuelson wrote:

> - Treat the file as though it were shipped in the package directly.
> *This means it is removed on package upgrade, as well as on package
> *removal. *This is very straightforward (append the filename to
> */var/lib/dpkg/info/{foo}.list), but perhaps not too useful.

Do you have a use-case for this? I guess such files would need to be
re-created on package upgrade and I'm not sure how useful this is.

> - Do not remove the file on package upgrade, but do remove it when
> *removing the package.

I would use this in clamav-unofficial-sigs.
Registration/de-registration would happen both at postinst time and
also runtime from a cron job.

--
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAKTje6G+DG4RiyytmFpvEP=-6444gdHwtdBhcDTmVNgDTP+2bQ@mail.gmail.com">http://lists.debian.org/CAKTje6G+DG4RiyytmFpvEP=-6444gdHwtdBhcDTmVNgDTP+2bQ@mail.gmail.com
 
Old 07-18-2011, 12:19 PM
Paul Wise
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Sun, Jul 17, 2011 at 1:04 AM, Peter Samuelson wrote:

> - Treat the file as though it were shipped in the package directly.
> *This means it is removed on package upgrade, as well as on package
> *removal. *This is very straightforward (append the filename to
> */var/lib/dpkg/info/{foo}.list), but perhaps not too useful.

Do you have a use-case for this? I guess such files would need to be
re-created on package upgrade and I'm not sure how useful this is.

> - Do not remove the file on package upgrade, but do remove it when
> *removing the package.

I would use this in clamav-unofficial-sigs.
Registration/de-registration would happen both at postinst time and
also runtime from a cron job.

--
bye,
pabs

http://wiki.debian.org/PaulWise


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAKTje6G+DG4RiyytmFpvEP=-6444gdHwtdBhcDTmVNgDTP+2bQ@mail.gmail.com">http://lists.debian.org/CAKTje6G+DG4RiyytmFpvEP=-6444gdHwtdBhcDTmVNgDTP+2bQ@mail.gmail.com
 
Old 07-18-2011, 03:27 PM
Christopher Baines
 
Default "register" files in dpkg database programmatically? (was How Debian Deals with Data)

On Mon, 2011-07-18 at 14:19 +0200, Paul Wise wrote:
> On Sun, Jul 17, 2011 at 1:04 AM, Peter Samuelson wrote:
>
> > - Treat the file as though it were shipped in the package directly.
> > This means it is removed on package upgrade, as well as on package
> > removal. This is very straightforward (append the filename to
> > /var/lib/dpkg/info/{foo}.list), but perhaps not too useful.
>
> Do you have a use-case for this? I guess such files would need to be
> re-created on package upgrade and I'm not sure how useful this is.

This could be used for the original suggestion of fetching data and
placing it on the system, if the data came in any format that allowed
updates of existing data, then the other way would be used (data
persistent when upgraded). This functionality would be very useful for
the above use case.

Chris
 

Thread Tools




All times are GMT. The time now is 12:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org