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 01-21-2008, 09:29 AM
Stefano Zacchiroli
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

On Sun, Jan 20, 2008 at 12:54:42PM -0500, Joey Hess wrote:
> Why are we copying shell functions off of wikis and embedding them into
> our maintainer scripts instead of adding the code to Debian once in a
> utility?

Full ack.

> (I've considered putting this code in debhelper, but the way it's used
> is not an especially good fit for debhelper.)

Nack. I think debhelper is the right place for this, since it is already
patching maintainer scripts for various reasons. What I would like to
see is a dh_something which would expand my #DEBHELPER# stem in
foo.preinst removing the obsolete conffile mentioned either on the
dh_something command line or in debian/foo.obsoleteconffile or
something.

Do you want a wishlist bugreport on debhelper for this?

Cheers.

--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{upsilon.cc,cs.unibo.it,debian.org} -<%>- http://upsilon.cc/zack/
(15:56:48) Zack: e la demo dema ? / All one has to do is hit the
(15:57:15) Bac: no, la demo scema / right keys at the right time
 
Old 01-21-2008, 09:32 AM
Stefano Zacchiroli
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

On Sun, Jan 20, 2008 at 05:34:53PM -0500, David Nusinow wrote:
> Indeed, the XSF is carrying around tons of shell functions that are
> generally useful and so should go in to some sort of central package, but
> there's nowhere to put them. Getting something like this started has been
> on the backburner for me for a while. I'd happily contribute what we've got
> to such a package, or help start one up.

Yeah, but a point is: should we make the snippet in a package and then
have a dependencies on this? This is going to be suboptimal since some
of those snippets have to be called in preinst and pre-depends are not
nice ...

Alternatively, we can have a library of snippets shipped by debhelper
and a generic debhelper tool to expand snippets in maintainer scripts,
but this sounds ugly as well (or not?).

Or, we should have a dh_something for each purpose, but that will bloat
the dh_namespace.

Cheers.

--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{upsilon.cc,cs.unibo.it,debian.org} -<%>- http://upsilon.cc/zack/
(15:56:48) Zack: e la demo dema ? / All one has to do is hit the
(15:57:15) Bac: no, la demo scema / right keys at the right time
 
Old 01-21-2008, 10:26 AM
Michael Biebl
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

Petter Reinholdtsen wrote:

[Michael Biebl]

Why do you think, debhelper is not the correct place to handle this?
Imho it would be fairly easy to write a debhelper command for this.
Another way would be, to make dpkg smarter about such cases. As you
want to write a special utility for this, how would you hook this up
into the install/upgrade process? If you have to edit maintainer
scripts again, you haven't gained a lot imho.


What API should be provided? I assume the script name and the version
it was removed would be enough?

Something like 'dh_obsolete /etc/init/oldfile 1.0.0-1', perhaps? One
entry per file?


Something like this, yeah. And optionally a third parameter if a
conffile has been moved.

dh_obsolete /etc/bar.conf 1.0.0.-1 /etc/bar/bar.conf

dh_obsolete sounds a bit weird in that case, so suggestions for better
names are welcome.


Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
 
Old 01-21-2008, 10:57 AM
Stephen Gran
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

This one time, at band camp, Michael Biebl said:
> Petter Reinholdtsen wrote:
> >[Michael Biebl]
> >>Why do you think, debhelper is not the correct place to handle this?
> >>Imho it would be fairly easy to write a debhelper command for this.
> >>Another way would be, to make dpkg smarter about such cases. As you
> >>want to write a special utility for this, how would you hook this up
> >>into the install/upgrade process? If you have to edit maintainer
> >>scripts again, you haven't gained a lot imho.
> >
> >What API should be provided? I assume the script name and the version
> >it was removed would be enough?
> >
> >Something like 'dh_obsolete /etc/init/oldfile 1.0.0-1', perhaps? One
> >entry per file?
>
> Something like this, yeah. And optionally a third parameter if a
> conffile has been moved.
> dh_obsolete /etc/bar.conf 1.0.0.-1 /etc/bar/bar.conf
>
> dh_obsolete sounds a bit weird in that case, so suggestions for better
> names are welcome.

My concern with this is that it can be important to have the files moved
in a particular order relative to other things happening in your
preinst, and a single #DEBHELPER# token might not be flexible. I'm sure
joeyh will come up with something simple, elegant, flexible and working
(on the first try), but I thought it worth mentioning.
--
-----------------------------------------------------------------
| ,'`. Stephen Gran |
| : :' : sgran@debian.org |
| `. `' Debian user, admin, and developer |
| `- http://www.debian.org |
-----------------------------------------------------------------
 
Old 01-21-2008, 05:39 PM
Joey Hess
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

Stephen Gran wrote:
> My concern with this is that it can be important to have the files moved
> in a particular order relative to other things happening in your
> preinst, and a single #DEBHELPER# token might not be flexible. I'm sure
> joeyh will come up with something simple, elegant, flexible and working
> (on the first try), but I thought it worth mentioning.

No, that's exactly why I feel it's not a good fit for a debhelper
command.

--
see shy jo
 
Old 01-21-2008, 05:57 PM
Joey Hess
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

Stefano Zacchiroli wrote:
> Yeah, but a point is: should we make the snippet in a package and then
> have a dependencies on this? This is going to be suboptimal since some
> of those snippets have to be called in preinst and pre-depends are not
> nice ...

Moving conffiles is very specific to dpkg, so the code to do it belongs
in dpkg, then all that's needed is a versioned (pre-)dependency on dpkg.

I prefer to not add big lumps of "snippet" code into debhelper, for many
reasons. Instead, we find an appropriate package, create an appropriate
utility in that package, and add the minimal boilerplate to debhelper to
be able to call it. A good example is update-icon-caches in libgtk2.0-bin.

--
see shy jo
 
Old 01-21-2008, 06:06 PM
Joey Hess
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

Michael Biebl wrote:
> Another way would be, to make dpkg smarter about such cases.
> As you want to write a special utility for this, how would you hook this
> up into the install/upgrade process? If you have to edit maintainer
> scripts again, you haven't gained a lot imho.

You've gained not copying dozens of lines of boilerplate, that are
fairly deeply tied into dpkg internals and have already bad to be
changed once, into maintainer scripts. It's just as useful as calling
update-alternatives from maintainer scripts, where despite there being no
debhelper command to do that, it's still better than copy-and-pasting in
a lot of code to manage the symlinks by hand.

The shell functions already have a fairly reasonable interface.
rm_conffile mypackage "/etc/pkg/conf.1"
prep_mv_conffile mypackage "/etc/pkg_conf.1"
mv_conffile "/etc/pkg_conf.1" "/etc/pkg/conf.1"
This is not the best possible interface; it would of course be better if
dpkg somehow figured this out on its own, or failing that if there was a
control file dpkg could read to tell it what to do. But this is the
interface that we're using, and I see no need to copy around large
blocks of shell code to use it.

--
see shy jo
 
Old 01-21-2008, 07:11 PM
Raphael Hertzog
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

On Mon, 21 Jan 2008, Joey Hess wrote:
> The shell functions already have a fairly reasonable interface.
> rm_conffile mypackage "/etc/pkg/conf.1"
> prep_mv_conffile mypackage "/etc/pkg_conf.1"
> mv_conffile "/etc/pkg_conf.1" "/etc/pkg/conf.1"
> This is not the best possible interface; it would of course be better if
> dpkg somehow figured this out on its own, or failing that if there was a
> control file dpkg could read to tell it what to do. But this is the
> interface that we're using, and I see no need to copy around large
> blocks of shell code to use it.

Maybe we could integrate those shell functions into the dpkg package
itself until dpkg is fixed to handle them better. At least, dpkg could
replace them with no-op when the proper support is in place.

Cheers,
--
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-21-2008, 07:47 PM
Stefano Zacchiroli
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

On Mon, Jan 21, 2008 at 01:57:34PM -0500, Joey Hess wrote:
> Moving conffiles is very specific to dpkg, so the code to do it belongs
> in dpkg, then all that's needed is a versioned (pre-)dependency on dpkg.

Well, yes, FWIW I would be perfectly fine with having such snippets in
the dpkg package itself. Would do dpkg maintainers think about it?

Cheers.

--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{upsilon.cc,cs.unibo.it,debian.org} -<%>- http://upsilon.cc/zack/
(15:56:48) Zack: e la demo dema ? / All one has to do is hit the
(15:57:15) Bac: no, la demo scema / right keys at the right time
 
Old 01-21-2008, 09:06 PM
Roger Leigh
 
Default Incorrect use of dpkg conffile suffixes and lintian checks

Raphael Hertzog <hertzog@debian.org> writes:

> On Mon, 21 Jan 2008, Joey Hess wrote:
>> The shell functions already have a fairly reasonable interface.
>> rm_conffile mypackage "/etc/pkg/conf.1"
>> prep_mv_conffile mypackage "/etc/pkg_conf.1"
>> mv_conffile "/etc/pkg_conf.1" "/etc/pkg/conf.1"
>> This is not the best possible interface; it would of course be better if
>> dpkg somehow figured this out on its own, or failing that if there was a
>> control file dpkg could read to tell it what to do. But this is the
>> interface that we're using, and I see no need to copy around large
>> blocks of shell code to use it.
>
> Maybe we could integrate those shell functions into the dpkg package
> itself until dpkg is fixed to handle them better. At least, dpkg could
> replace them with no-op when the proper support is in place.

A fix in dpkg would, IMO, be ideal. I think that the case of dropped
conffiles should really be being handled properly by dpkg in any case.
I'm not sure why it can't just keep track of them until you purge the
package, or delete them outright. Either way, I don't see the need to
leave such as basic task to be implemented by every package maintainer
who ever removes a conffile.

In the meantime, having the shell functions in dpkg itself would be
very useful. However, how will etch->lenny upgrades work without a
new dpkg containing the functions?


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.
 

Thread Tools




All times are GMT. The time now is 05:33 PM.

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