Bug 8946

Summary: opkg install does not appear to fail on file overwrite
Product: [Yocto Project Subprojects] opkg Reporter: Richard Tollerton <rich.tollerton>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED NOTABUG QA Contact:
Severity: major    
Priority: Undecided CC: joshua.prewitt
Version: 0.3.1   
Target Milestone: 0.3.6   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Richard Tollerton 2016-01-19 17:54:17 UTC
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8354#c2 implies that `opkg install` is ignoring whether a file already exists on disk.

In general, it probably ought to be failing the install entirely, regardless of whether or not the file is tracked or untracked. (The only reason it ought to not fail is on upgrade.)

I haven't specifically tested for this myself, although I vaguely recall seeing related behaviors before.
Comment 1 Alejandro del Castillo 2017-09-16 21:53:10 UTC
Not able to reproduce. I used the testcase:

import os
import opk, cfg, opkgcl

opk.regress_init()


f = open("test_file", "w")
f.write("Test")
f.close()

o = opk.OpkGroup()

pkg = opk.Opk(Package="a")
pkg.write(data_files=["test_file"])
o.addOpk(pkg)

pkg2 = opk.Opk(Package="b")
pkg2.write(data_files=["test_file"])
o.addOpk(pkg2)

o.write_list()
opkgcl.update()

then I ran:

adelcast@delcastillo2 ~/git/opkg/tests $ opkg -o /tmp/opkg install a
Installing a (1.0) on root
adelcast@delcastillo2 ~/git/opkg/tests $ opkg -o /tmp/opkg install b
Installing b (1.0) on root
To remove package debris, try `opkg remove b`.
To re-attempt the install, try `opkg install b`.
Collected errors:
 * check_data_file_clashes: Package b wants to install file /tmp/opkg/test_file
	But that file is already provided by package  * a

There might be a case where check_data_file_clashes is failing, but I am going to need more information to go on. Please re-open if you find a failing case.