[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging phpLDAPadmin. Newbie's questions.



On Sat, 15 Nov 2003 08:02:04 +1100, Matthew Palmer <mpalmer@debian.org> said: 

> On Fri, Nov 14, 2003 at 09:32:48AM -0600, Manoj Srivastava wrote:
>> On Fri, 14 Nov 2003 10:46:35 +1100, Matthew Palmer
>> <mpalmer@debian.org> said:
>> > the user hasn't used debconf to make the change.  To cover that
>> > circumstance, I've started to make a file containing an md5sum of
>> > the config file, and before I change it I make sure the user
>> > hasn't.  If they've changed it at all (so the md5sum has
>> > changed), I don't make any modifications and it's then the user's
>> > problem to keep it up to date.  It's by no means perfect, but it
>> > follows Policy's "must keep local config changes", and doesn't
>> > require pre- and post-knowledge of what the options were in
>> > Debconf.
>>
>> This is suboptimal.  If there are changes that would be made to a
>> file if the user has not modified the file, then the user should be
>> offered the choice to accept these changes even if they have
>> modified the configuration file on their own. The "my way or the
>> high way" approach is a dissservice to our users.

> OK, so I'll add a question asking part to my script.  It doesn't
> mean the entire concept is flawed.

	Sure, you can reinvent the wheel. Don't forget to add an
 option to diff the changes between the current and the new, an option
 to escape to shell, and preference setting that make the question
 default to either always accpting the current configuration file, or
 always accepting the maintainers version. Also remember to keep a
 copy of the old file around (.dpkg-old), or the new versions,
 (.dpkg-dist) so that the user can go back and modify things at a
 later time.

	Or, just use ucf ;-)

>> Check out ucf; it has been specifically written to allow you to
>> offer the user a choice, exactly like dpkg does for conffiles.

> But it's still "all my changes or all your changes", right?  Which
> is "my way or the highway" asked on every upgrade... <g>

	I then suggest you look at the three way merge option
 implemented by ucf, that lets the user opt to apply the delta change
 in this version of upstreams file (the relevant changeset) to the
 previously modified local version.  Also, the user can do a diff, and
 can later compare the blah.dpkg-dist file to the configuration file
 and merge in changes manually -- at least the .dpkg-dist file is
 available to do so.

> Anyway, last time I looked at ucf it's documentation spent a lot of
> time discussing esoteric examples and absolutely no time showing me
> how to apply it to my packages.  On a hunch, I just went and
> installed the latest version of ucf, and it appears that the
> documentation has morphed into something useful, so my homegrown
> hack's days may be numbered.

	A patch to the documentation would have been appreciated.

	manoj
-- 
If I promised you the moon and the stars, would you believe it? Alan
Parsons Project
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



Reply to: