Bug 1136453 - RFE: Implement %ghost(noremove)
Summary: RFE: Implement %ghost(noremove)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-02 15:24 UTC by Miroslav Suchý
Modified: 2019-11-28 14:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-28 09:44:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miroslav Suchý 2014-09-02 15:24:30 UTC
I just learn about:
  https://fedoraproject.org/wiki/PackagingDrafts/Logfiles
So the proposal (and some packages are already using this) is to mark log files beside %ghost flag additionaly with %config as well.
This is clearly misuse of %config, because log files are not configs.

The case which the proposal is trying to solve is: "to not remove log files, when package is removed."

I belive that new attribute:
  %ghost(noremove)
with the semantic:
  "This file is marked as %ghost, but during removal of the package, the files is not removed."
can solve the problem.

Comment 1 Panu Matilainen 2014-09-03 06:24:46 UTC
%config %ghost has exactly the semantics needed in every ancient rpm version out there, inventing a new incompatible flag (whether as a syntactic sugar for %config or actual pkg level flag) "just because" doesn't seem particularly useful to me. I can promise you rpm wont mind packagers lying about the log file contents ;)

Comment 2 Miroslav Suchý 2014-09-03 06:33:59 UTC
> I can promise you rpm wont mind packagers lying about the log
file contents.

But I (as author rpmconf) mind about that. If you ask rpm what *config* files mysql have, you will get:
# rpm -qc mariadb-server
/etc/logrotate.d/mariadb
/etc/my.cnf.d/server.cnf
/etc/my.cnf.d/tokudb.cnf
/var/log/mariadb/mariadb.log
/var/log/mysqld.log

And users need to solve rpmnew/rpmsave differences on log files, which is nonsense. Of course I can code some heuristic, but that would not be systematic approach.

Comment 3 Jan Zeleny 2014-09-03 06:47:13 UTC
I will also add one more thing. There is a proposal floating around to automatically extract config files into subpackages. While nothing has been decided about it, if packages misuse %config to mark log files as well, it will block one of the possible solutions how to detect the config files. At this point I'm not inclined to any side, I just want this to be taken into account (maybe there is a way how to detect the config files other than detecting the %config flag?)

Comment 4 Panu Matilainen 2014-09-03 06:51:48 UTC
(In reply to Miroslav Suchý from comment #2)
> > I can promise you rpm wont mind packagers lying about the log
> file contents.
> 
> But I (as author rpmconf) mind about that. If you ask rpm what *config*
> files mysql have, you will get:
> # rpm -qc mariadb-server
> /etc/logrotate.d/mariadb
> /etc/my.cnf.d/server.cnf
> /etc/my.cnf.d/tokudb.cnf
> /var/log/mariadb/mariadb.log
> /var/log/mysqld.log
> 
> And users need to solve rpmnew/rpmsave differences on log files, which is
> nonsense. Of course I can code some heuristic, but that would not be
> systematic approach.

Well you need to make rpmconf aware of %ghosts anyway because its what existing packages rely on. There's no need for heuristics as %ghost %config file is truly ignored always, no .rpmnew/.rpmsave etc files are ever created, and unlike other ghosts they're not removed either.

Sure I too would prefer if all %ghost, %config etc were defined in terms of what they actually do instead of these magic incantations to get desired behavior, but it is what it is. So all I can say is "maybe someday", its not that the idea is bad its just not exactly on the top of priorities.

Comment 5 Miroslav Suchý 2014-09-03 07:03:23 UTC
> no .rpmnew/.rpmsave etc files are ever created

Well I have /var/log/mysqld.log.rpmnew as symlink to /var/log/mariadb/mariadb.log on my disk. This is how I got to this topic.

> not exactly on the top of priorities

*nod*

Comment 6 Panu Matilainen 2014-09-03 07:13:50 UTC
(In reply to Miroslav Suchý from comment #5)
> > no .rpmnew/.rpmsave etc files are ever created
> 
> Well I have /var/log/mysqld.log.rpmnew as symlink to
> /var/log/mariadb/mariadb.log on my disk. This is how I got to this topic.

It hasn't always been a %ghost, in fact its only been marked as such fairly recently:

commit 9aff247e120300d67cb66f8c35be9c7eb919a125
Author: Honza Horák <hhorak>
Date:   Mon Jan 6 18:09:21 2014 +0100

    Use %%ghost directive for the log file
    Related: 1043501

%ghost %config as such will never create .rpmnew/.rpmsave/.rpmorig files.

Comment 7 Florian Festi 2019-11-28 09:44:31 UTC
I don't see any new flags necessary nor happening. Closing.

Comment 8 Miroslav Suchý 2019-11-28 14:18:35 UTC
/me is very sad about this resolution. :(


Note You need to log in before you can comment on or make changes to this bug.