Hello,
We have recently discussed here about task-obsolete.
http://www.mail-archive.com/mageia-dev@mageia.org/msg09762.html
https://bugs.mageia.org/show_bug.cgi?id=3786
I like the idea.
But I think that we need to inform the user about the package(s) that we
will obsolete and remove on his system (and why: security, ..).
So I tried to use README.*.urpmi to do this.
But I found that currently, urpmi and rpmdrake don't handle very well
optional README.*.urpmi (%ghost); they always display information's
screen, even if the file doesn't exist.
So, I propose here 2 enhancements for README.*.urpmi (POC patch for
urpm/install.pm, and task-obsolete.spec in attachment):
1) add support for optional README.*.urpmi (%ghost in spec):
This will allow to build this README.*.urpmi at install time in %pre,
%post or %trigger only when it's necessary.
One use case from the recent past in my mind:
we have no way to inform users that still use nspluginwrapper + i586
flashplayer on x86_64 (and only them), that this is now deprecated and
they should replace the i586 by the x86_64 flashplayer,
https://bugs.mageia.org/show_bug.cgi?id=2146#c22
https://bugs.mageia.org/show_bug.cgi?id=2146#c25
2) handle README.*.(obsolete|deprecated).urpmi
In order to display informations about the deprecated or obsoleted
package(s), I suggest to handle 2 new kinds of README.*.urpmi:
- README."nameObsoletedPackage".obsolete.urpmi to inform about the
package we obsolete by task-obsolete
e.g. java-1.6.0-sun*, https://bugs.mageia.org/show_bug.cgi?id=3101
- README."nameDeprecatedPackage".deprecated.urpmi to inform about
package that we considere as deprecated, but we have no reason (no
vulnerability, security, ...) to force uninstallation (task-deprecated?).
What do you think ?
--
Luc Menut
Index: urpm/install.pm
===================================================================
--- urpm/install.pm (révision 2572)
+++ urpm/install.pm (copie de travail)
@@ -109,11 +109,14 @@
foreach my $file ($pkg->files) {
my ($kind) = $file =~ m!/README([^/]*)\.urpmi$! or next;
+ -r $file or next;
my $valid;
if ($kind eq '') {
$valid = 1;
} elsif ($kind eq '.install' && !$pkg->flag_installed) {
$valid = 1;
+ } elsif ($kind =~ /(.*)\.(deprecated|obsolete)$/) {
+ $valid = 1;
} elsif ($kind =~ /(.*)\.(upgrade|update)$/ && $pkg->flag_installed) {
if (!$1) {
$valid = 1;
Name: task-obsolete
Version: 1
Release: %mkrel 1
Summary: POC task-obsolete
Group: Development/Other
License: GPL
BuildArch: noarch
Obsoletes: null
Obsoletes: null-dummy
%description
Proof of concept to test task-obsolete and conditionnal messages
with README.*.obsolete.urpmi when obsoleting package.
%prep
%build
%install
install -d -m755 %{buildroot}%{_defaultdocdir}/%{name}
touch %{buildroot}%{_defaultdocdir}/%{name}/README.null.obsolete.urpmi
touch %{buildroot}%{_defaultdocdir}/%{name}/README.null-dummy.obsolete.urpmi
%triggerin -- null
cat > %{_defaultdocdir}/%{name}/README.null.obsolete.urpmi <<EOF
null is installed on this system.
it is an useless package on end user systems.
it will be uninstalled.
EOF
%triggerin -- null-dummy
cat > %{_defaultdocdir}/%{name}/README.null-dummy.obsolete.urpmi <<EOF
null-dummy is installed on this system.
it is an useless package on end user systems.
it will be uninstalled.
EOF
%files
%dir %{_defaultdocdir}/%{name}
%ghost %{_defaultdocdir}/%{name}/README.null.obsolete.urpmi
%ghost %{_defaultdocdir}/%{name}/README.null-dummy.obsolete.urpmi