From 389b1ab706be8eddba9f00c7084759f670ce96ac Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 8 Oct 2012 09:27:18 +0300 Subject: Don't bother calculating digests of %ghost %config files - Calculating digest of %ghost config is useless as there's nothing to compare the result to. Also we never take backups of %ghost configuration anyway, so this is a total waste of time. One common case of %ghost %config is the rpmdb (environment and all) which can be rather large and calculating digests can take several seconds, only for the results to be thrown away unused. - There are some cases where it might be reasonable to back up %ghost %config (eg if it gets replaced by non-config), but rpmfiConfigConflictIndex() doesn't have sufficient context to figure that out. For now, preserve the traditional simple rule: no backups for ghosts, ever. --- lib/rpmfi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rpmfi.c b/lib/rpmfi.c index cf968bdab..c61ba21e5 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -659,7 +659,8 @@ int rpmfiConfigConflictIndex(rpmfi fi, int ix) struct stat sb; int rc = 0; - if (!(flags & RPMFILE_CONFIG)) + /* Non-configs and ghosts are not config conflicts. */ + if (!(flags & RPMFILE_CONFIG) || (flags & RPMFILE_GHOST)) return 0; /* Only links and regular files can be %config, this is kinda moot */ -- cgit v1.2.3