Permalink
Browse files

detect change in rpm epoch, name, version, release

ITIL compliance requires that _every_ package
change is detectable.

This fix ensures etckeeper properly reports any
change in rpm manifest, including epoch and release.
It uses an RPM query-format string that yields
reproducible results.

By example, assume you update a package that
differs only in the release number.

Before fix, etckeeper logs:
    committing changes in /etc after yum run

    Package changes:

After fix, etckeeper logs:
    committing changes in /etc after yum run

    Package changes:
    -0:baseline-0.3.6-2.fc13.noarch
    -0:baseline-devel-0.3.6-2.fc13.noarch
    -0:baseline-release-0.3.6-2.fc13.noarch
    +0:baseline-0.3.6-3.fc13.noarch
    +0:baseline-devel-0.3.6-3.fc13.noarch
    +0:baseline-release-0.3.6-3.fc13.noarch

Signed-off-by: Paul Morgan <jumanjiman@gmail.com>
  • Loading branch information...
1 parent 4b8a70e commit 35080371afca5c81f8de7838661d5322dc39d98e @jumanjiman jumanjiman committed with joeyh Nov 4, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 list-installed.d/50list-installed
View
2 list-installed.d/50list-installed
@@ -6,5 +6,5 @@ if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
egrep '(ok installed|ok config-files)' | cut -f2,3
elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
- rpm -qa --queryformat "%{name} %{version} %{arch}\n" | sort
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
fi

0 comments on commit 3508037

Please sign in to comment.