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

Fwd: Re: apt-get install --reinstall --reset <pkg>



David Kalnischkies wrote:
APT has no debconf questionstuff so it doesn't need to…
and adding it just for such a feature is not really a good idea.

Why? If I would want to configure the package again, I would get the wrong defaults.
If you want you can check for debconf existence at runtime instead.

OK.

(reordered quote)

Is there anything else to do to get it work?

You mean beside documentation in the manpages? ;)

Of course.
Reset is a quite generic name. What will it do, reset the automatic
install flag, reset some other state information, some queried action
like in dselect or aptitude… Possibilities are endless, but
it discards local configuration changes, doesn't it?

Yes, but you could use "ResetConfig" internal and "reset" for apt-get, because no end-user wants to "reset some other state information".
and in apt-get/deb/dpkgpm.cc:
     case Item::ReSet:
     Args[n++] = "--force-confask";
     Size += strlen(Args[n-1]);
     Args[n++] = "--force-confnew";
     Size += strlen(Args[n-1]);
     break;

First, you should make clear what you want:
 From this fragment it looks like an action "dpkg --reset" would
exist which is comparable to the other actions like "dpkg --unpack"
or "dpkg --configure" which APT needs to be told about in a few
places as it needs to order them.
I think you don't want that.

You're right.
Next point is, you should be able to have this functionality on
the fly with every APT version with the DPkg::Options list.

I know, you could use that to implement this functionality in Synaptic, but an apt-get user wants an easy interface.
If you want to implement it clean - in a way that a user can e.g.
schedule it just like he can do it for reinstall or purge in one batch
you need to go a similar route as the reinstall flag works, but with
the difference that you need to tell the actionorderer about it:
It can make a big difference if
dpkg --configure A B  is called or
dpkg --configure A and
dpkg --configure B
so if you want to apply the options only to A you need to split
the first call and action orderer needs to know about it.
(same for --unpack and the other dpkg calls)

You mean, if there is an maintainer script for an configuration file in package B which reads configuration from package A? I have no clue.
I am not sure if this feature will be worth the hassle as purge and
install will do the same just in two calls - or the hinted option
list can be used in one call - and i was never at a point to need
such a functionality at all… (but reinstall too).

You not, but a lot of others. For example the guy, who said "I recently installed Samba and I messed up the /etc/samba/smb.conf file"[1] or "I've occasionally lost my config file "/etc/mysql/my.cnf", and want to restore it."[2]

purge and reinstall only works for packages which you can remove without removing of the whole system. Try to purge and reinstall "dpkg".

regards,
Daniel Bock

[1] http://superuser.com/questions/69045/how-do-i-get-the-default-configuration-from-a-deb-file [2] http://serverfault.com/questions/82801/linux-how-to-restore-config-file-using-apt-get-aptitude


Reply to: