Bug 10694

Summary: rpm does not detect file clashes on do_rootfs
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Markus Lehtonen <markus.lehtonen>
Component: devtools / tool chainAssignee: dengke <dengke.du>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium+ CC: mark.hatle, markus.lehtonen, meta.mr.watcher, meta.watcher
Version: 2.2   
Target Milestone: 2.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Markus Lehtonen 2016-11-18 14:43:43 UTC
I accidentally stumbled on this when working on bug 10433.

When using package_rpm I didn't get any error even if two packages provided the same file on the target. Package that gets installed later seems to happily overwrite the file (after which both packages own it).

With ipk, I get an error as expected:
Collected errors:
 * check_data_file_clashes: Package busybox-syslog wants to install file /home/marquiz/yocto/openembedded-core/build-10433/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/rootfs/etc/init.d/syslog
	But that file is already provided by package  * sysklogd
 * opkg_solver_install: Cannot install package packagegroup-core-boot.
/build-10433/tmp-glibc/deploy/ipk/i586/eudev_3.2-r0_i586.ipk.
Comment 1 dengke 2017-01-03 08:51:38 UTC
Hi Markus

The following is my steps to reproduce the errors.

1. add IMAGE_INSTALL_append = " busybox-syslog sysklogd" to conf/local.conf
2. add PACKAGE_CLASSES ?= "package_ipk"
3. bitbake core-image-minimal

No errors appear, how can I reproduce it? Thanks.
Comment 2 Markus Lehtonen 2017-01-04 07:48:27 UTC
Oops, I forgot to share the code to reproduce my problem. Please try out

git://git.openembedded.org/openembedded-core-contrib marquiz/debug-10694

On branch that you should be able to reproduce the problem with the steps you described.
Comment 3 dengke 2017-01-12 09:59:12 UTC
Hi Markus

The smart can't detect the file clashes, this is an old issue, but the opkg and dpkg can. We will drop the smart package manager, and use the dnf package manager in the future.

Thanks.
Comment 4 Markus Lehtonen 2017-01-12 13:52:53 UTC
But, I think this is a bug in rpm. Rpm should detect that it tries to install a package that would overwrite a file already owned by another package (or tries to simultaneously install two packages providing the same file).
Comment 5 dengke 2017-01-13 01:41:27 UTC
(In reply to comment #4)
> But, I think this is a bug in rpm. Rpm should detect that it tries to
> install a package that would overwrite a file already owned by another
> package (or tries to simultaneously install two packages providing the same
> file).

I think detecting the file's owner is the business of package manager.
Comment 6 Markus Lehtonen 2017-01-13 08:08:33 UTC
And by package manager you mean RPM?

It is definitely the job of rpm to keep track (in it's database) about the ownership, checksum etc of files. It is not (only) the responsibility of smartpm, dnf or similar. Packages can be installed with rpm directly, i.e. not using e.g. smartpm, and it needs to detect clashes.
Comment 7 Mark Hatle 2017-08-03 22:20:26 UTC
The RPM rule is:

If both packages provide the -same- file, then it is allowed.  On package removal, only the last removal will erase the file.

This is the RPM mechanism that allows multiple packages to provide common man pages, configuration files and other components.

If you have an example where two packages install -different- contents, and do not error.  Then there is an error in RPM, as this should be detected.
Comment 8 Markus Lehtonen 2017-08-06 16:57:16 UTC
Yes, this was about a common file with _different_ content being provided by two packages. But, it was with rpm5 so I think this could be closed now.
Comment 9 dengke 2017-08-29 01:19:55 UTC
As Markus mentationed, this bug was with rpm5, so we can close it.