RPM

Comment 4 for bug 638600

Revision history for this message
In , Miloslav (miloslav-redhat-bugs) wrote :

Created attachment 330017
spec files for test rpms

Attached are specs for test RPMs. s,/home/mitr/ht,your_test_directory,g, and build all using the default settings (md5), and build all but *1.spec with "--define '_binary_filedigest_algorithm 8'" as well.

Setting up testing environment
==============================
ht=/home/mitr/ht # or your own
mkdir -p $ht/rpmdb
cd $ht
myrpm() { rpm --dbpath $ht/rpmdb "$@"; }
myrpm --initdb

Testing %config handling (rpmfiDecideFate)
==========================================
# %files of ht_config* contain:
# %config(noreplace) config_file
# %config config_replace
for action in (do nothing, change config_*), new in (changed,same) do:
    myrpm -ivh ht_config-1-1.noarch.rpm
    # $action
    myrpm -Uvh ht_config-2$new-1.noarch.rpm
    ll $ht/config_*
    myrpm -ev ht_config

results when all packages use md5:
    (do nothing, changed): files changed
    (do nothing, same): file dates changed
    (change files, changed): creates config_file.rpmnew, config_replace.rpmsave;
                             on erase creates config_file.rpmsave
    (change files, same): changes kept on disk;
                          on erase .rpmsave created for both files
results when *1 uses md5, *2* uses sha2:
    (do nothing, changed): files changed
    (do nothing, same): file dates changed
    (change files, changed): files overwritten, old data lost!
    (change files, same): files overwritten, old data lost!
results when *1 uses md5, *2* uses sha2, after applying rpm-4.6.0-rc3-config-hashes.patch:
    (do nothing, changed): files changed
    (do nothing, same): file dates changed
    (change files, changed): creates config_file.rpmnew, config_replace.rpmsave;
                             on erase creates config_file.rpmsave
    (change files, same): config_file change kept on disk (creates .rpmnew),
               config_replace overwritten (creates .rpmsave)
     on erase creates config_file.rpmsave

Testing file conflict handling (handleInstInstalledFiles, handleOverlappedFiles):
================================================================================
for kind in (same,different), action in (together,separately):
    other=ht_conflict$(kind==same ? 1a : 2)-1-1
    if action==together:
        myrpm -ivh ht_conflict1-1-1.noarch.rpm $other.noarch.rpm
    else:
        myrpm -ivh ht_conflict1-1-1.noarch.rpm
        myrpm -ivh $other.noarch.rpm
    myrpm -ev ht_conflict1 $other
results when all packages use md5:
    (same,together): installs OK
    (same,separately): installs OK
    (different,together): conflict message, nothing installed
    (different,separately): conflict message, $other not installed
Results when *1.* uses md5, $other uses sha2:
    (same,together): conflict message, nothing installed
    (same,separately): conflict message, $other not installed
    (different,together): conflict message, nothing installed
    (different,separately): conflict message, $other not installed