Bug 8946 - opkg install does not appear to fail on file overwrite
Summary: opkg install does not appear to fail on file overwrite
Status: RESOLVED NOTABUG
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.3.1
Hardware: All Multiple
: Undecided major
Target Milestone: 0.3.6
Assignee: Alejandro del Castillo
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-01-19 17:54 UTC by Richard Tollerton
Modified: 2017-09-16 21:53 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.