Bug 11332 - opkg does not trim Provides strings and may miss Provides with Windows line endings
Summary: opkg does not trim Provides strings and may miss Provides with Windows line e...
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.3.4
Hardware: x86 x86_64
: Undecided normal
Target Milestone: 0.3.5
Assignee: Alejandro del Castillo
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-04-11 16:32 UTC by Paul Spangler
Modified: 2017-04-19 21:36 UTC (History)
0 users

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


Attachments
Example reproduction feed (2.41 KB, application/x-download)
2017-04-11 16:32 UTC, Paul Spangler
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Spangler 2017-04-11 16:32:07 UTC
Created attachment 3708 [details]
Example reproduction feed

opkg is tolerant for Windows line endings in a feed, but appears to have missed trimming the Provides string before processing it, unlike other relationship strings. Installing a package from a feed that uses Windows line endings results in the Provides string keeping an extra \r at the end, which prevents the solver from detecting other relationships such as a conflicts.

See the attached example feed with two empty packages that conflict using a virtual package. For example, I see the following in /var/lib/opkg/status:

Package: test-package-1
Version: 1.0.0-0
Provides: test-virtual-package^M
Replaces: test-virtual-package
Conflicts: test-virtual-package
Status: install ok installed
Architecture: x64
Installed-Time: 1491928274

Expectation
-----------
# opkg install test-package-1 test-package-2
Solver encountered 1 problem(s):
Problem 1/1:
  - package test-package-2-1.0.0-1.x64 conflicts with test-virtual-package provided by test-package-1-1.0.0-0.x64

Solution 1:
  - do not ask to install a package providing test-package-2

Solution 2:
  - do not ask to install a package providing test-package-1

Actual Result
-------------
# opkg -v
opkg version 0.3.4 (libsolv 0.6.24)
# opkg install test-package-1 test-package-2
Installing test-package-1 (1.0.0) on root
Installing test-package-2 (1.0.0) on root
Configuring test-package-1.
Configuring test-package-2.
Comment 1 Alejandro del Castillo 2017-04-19 21:36:29 UTC
fixed on commit f6f0aee288bf4cdd56fb355ba90d95039782528b