diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-10-08 09:27:18 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-10-08 09:38:57 +0300 |
commit | 389b1ab706be8eddba9f00c7084759f670ce96ac (patch) | |
tree | 87e0825574f111733400a1cee1127dfef7f7ec60 | |
parent | e17bf0449dc54d007b66954170b9d12dad1e74a2 (diff) | |
download | rpm-389b1ab706be8eddba9f00c7084759f670ce96ac.tar.gz rpm-389b1ab706be8eddba9f00c7084759f670ce96ac.tar.bz2 rpm-389b1ab706be8eddba9f00c7084759f670ce96ac.zip |
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.
-rw-r--r-- | lib/rpmfi.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |