[bt-devel] RFC: Remove modules installed by the native package manager
Sveinung Kvilhaugsvik
sveinung84 at users.sourceforge.net
Tue Apr 28 18:11:55 MST 2009
Hi Eeli.
Thanks for your comments. I'm sorry if this email sounds rude,
arrogant, angry, stupid etc. I'm a little bit to tired to check the
tone in a foreign language (and that may also make me misunderstand
what you wrote) but I wanted to answer you at once. :)
> Without knowing what the patch currently does, the fully working solution
> should be something like this:
>
> It detects the packages which are installed by the package manager. When the
> "Installed works" page in the Bookshelf Manager is opened, it marks those
> modules.
Hmm. I considered that. (The way it works now is that it checks if
something is packaged during removal to keep the changes as simple as
possible) It could fix the issue I have in patch3. One reason I didn't
do it was that that marking it the UI what modules are package managed
would be a bigger change and I know big changes generally are harder
to get merged than small changes. (But I guess having a developer
suggest it removes that problem :) ) Another problem with it is that
detecting which works are installed by the package manager takes some
time for each work. One consequence of this is that the UI would be
slow to get up or marking things after it had started. Another is that
if a removal would start before the searches were finished the result
could be package database corruption (in the same case that would give
it today, ie running as root). Of course it's possible to delay the
removal until the search is finished by graying out the remove button
or to have the remove code wait until all the results were returned.
The last case would keep today's problem if the window were closed to
early. Or did you mean to check which works are package managed before
we get to the remove section? I'm not that familiar with BibleTime's
code base (or C++ and Qt) so I would appreciate a hint to where you
think it belonged in that case (and how to share the data with other
classes).
> We have to suppose that BibleTime is used with normal privileges, not as
> root.
Sure. PackageKit uses PolicyKit so BibleTime run with normal
privileges. When BibleTime try to remove a module PolicyKit can permit
it, deny it or require a password.
> If the user tries to uninstall those modules, it opens a dialog telling that
> the modules (works) have been installed by the package manager and that
> those packages can now be uninstalled.
Would this be needed in every case or is the "normal" removal dialog
(+ a dialog from PolicyKit if it demands a password) needed? (On one
hand it's a nice feature to warn people that they are removing
something for all users, on the other hand some may find it annoying
with to many dialogs) Perhaps modify the "normal" one to warn about
that?
> This is the critical part: it should now change to use admin priviledges,
> using the system used by the distro.
My impression is that distros are moving towards PolicyKit. Now that
it's included in KDE[1] too I think it will get even more widespread.
> In any case we need to have detection for nonwritable/nonremovable
> directories.
Agreed. Ideally it would be marked in the UI if a work is writable,
package managed or not writable. What about marking works with colors
depending on the status like you today use color to mark updates? For
example red for not writable, yellow for package managed and white for
writable.
> And if PackageKit is used
> for the managed modules, it would be illogical to not offer a possibility to
> remove the other non-writable files, too.
You could argue that if a user has installed modules in a non-writable
location he knows what he is doing so he knows how to remove them. (If
he just accidentally installed them as root he might also accidentally
remove packaged modules as root and corrupt his package database) If
he has them as packages, on the other hand, they could be installed by
his package manager when he installed BibleTime. So IMHO PackageKit
should have a higher priority than removing other works that are
installed to non writable locations. But I agree that it would be nice
to have. One way to implement this, at least for platforms that
support it, could be to use PolicyKit like PackageKit does. (Or use an
abstraction[2] that would make it work with Windows and OS X too) But
it would be a lot more work than just PackageKit since the system part
of PackageKit already is written.
1 http://lists.kde.org/?l=kde-core-devel&m=123817501131723&w=2
2 http://lists.kde.org/?l=kde-core-devel&m=123772511208881&w=2
Sveinung
More information about the bt-devel
mailing list