Bug 164432

Summary: rpm creates *.rpmnew files even when no changes were made
Product: [Fedora] Fedora Reporter: Jakub Jelinek <jakub>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: axel.thimm, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-27 02:29:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jakub Jelinek 2005-07-27 20:54:51 UTC
On x86-64, do:

#!/bin/sh
cat > test1.spec <<\EOF
Summary: The foo(tm) package
Name: test
Version: 1.0
Release: 1
Group: System Environment/Libraries
License: GPL
Buildroot: /var/tmp/%{name}-root
%description
foo
%prep
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{/usr/%{_lib},/usr/lib/foo}
echo 'int i;' | gcc $RPM_OPT_FLAGS -shared -O2 -fpic -o $RPM_BUILD_ROOT/usr/%{_lib}/libfoo.so -xc -
echo config test > $RPM_BUILD_ROOT/usr/lib/foo/config
%clean
rm -r $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/%{_lib}/libfoo.so
%dir /usr/lib/foo
%config(noreplace) /usr/lib/foo/config
EOF
sed 's/Version: 1.0/Version: 1.1/' test1.spec > test2.spec
rpmbuild -ba -v test1.spec
rpmbuild -ba -v test2.spec
i386 rpmbuild -ba -v --target i386 test1.spec
i386 rpmbuild -ba -v --target i386 test2.spec
rpm -Uvh /usr/src/redhat/RPMS/{i386,x86_64}/test-1.0-1.*.rpm
rpm -Uvh /usr/src/redhat/RPMS/{i386,x86_64}/test-1.1-1.*.rpm

The last command will show messages about creating /usr/lib/foo/config.rpmnew,
which will be identical to /usr/lib/foo/config

Comment 1 Tomas Mraz 2005-08-05 12:57:39 UTC
They differ in mtime - see also bug 128622

I also think that the .rpmnew files shouldn't be created if the original file
differs from the original rpm only in mtime.


Comment 2 Jeff Johnson 2005-08-27 02:29:57 UTC
The existing behavior -- exactly the same as forevermore -- checks mtime.

Too bad that better could be done, I don't have the stomach for the battle to change
how %config files are handled.