Re: Display a message on the console while upgrading a package

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

 



On Tue, Mar 30, 2021 at 07:11:16PM +0200, Robert-André Mauchin wrote:
> Hello,
> 
> Following a change in the config file of a program, I'd like to
> display a message to my users to indicate they need to update the
> config file with the new one. I try "echo" in the update scriptlet:
> 
> %postun
> if [ "$1" -ge "1" ] ; then # Upgrade
>   dnscrypt-proxy -service install --config
> %{_sysconfdir}/dnscrypt-proxy/dnscrypt-proxy.toml
>   echo 'Since version 2.0.45, some of the configuration files have
> been renamed.
>   Please merge your config to
> /etc/dnscrypt-proxy/dnscrypt-proxy.toml.rpmnew then
>   replace dnscrypt-proxy.toml with that file.
>   Read /usr/share/doc/dnscrypt-proxy/ChangeLog to merge files accordingly.'
> fi
> 
> But it doesn't work as expected. Is there a way to transmit that
> message to my users?

There is no good way to do this. In particular, when you consider that
some people use 'sudo dnf' from the command line, some use PackageKit,
and some use dnf-automatic and such, there is mechanism that would cover
all cases.

But even if there was, it wouldn't be desirable to do this. Many
people won't read the notification, and even if they did, they
wouldn't act on it. In general, the assumption is that any update
*must* take care of upgrading the configuration. And incompatible
config-format changes in a released Fedora version are discouraged.

Simply put, upstream shouldn't do such backwards-incompatible changes
without a very good reason. There is really no nice way to handle this
in a package [*]. If the update can't be done automatically, then making
the service fail to start as described as suggested in the other part
of the thread is an option. Either way, this most likely should only
happen in rawhide.

Zbyszek

[*] Sometimes, a breaking change is unavoidable. For example, major
version bumps of a database, in particular postgresql. But I doubt
that this config format change is like that and the code couldn't have
been made to read both the old and new formats.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux