<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8340</bug_id>
          
          <creation_ts>2015-09-20 22:26:23 +0000</creation_ts>
          <short_desc>libopkg needs a better error reporting mechanism (old issue #63)</short_desc>
          <delta_ts>2021-07-08 17:04:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>ACCEPTED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>next-minor</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alejandro del Castillo">alejandro.delcastillo</reporter>
          <assigned_to name="Alex Stewart">alex.stewart</assigned_to>
          <cc>alex.stewart</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54317</commentid>
    <comment_count>0</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-20 22:26:23 +0000</bug_when>
    <thetext>Users of libopkg have no reasonable way of determining the error from opkg. I don&apos;t like the idea of having a list of return codes with various meanings (a la errno), as this makes it difficult to give accurate information about specific errors. A function returning the last known error would be a good option (e.g. sqlite&apos;s sqlite3_errmsg()).

Originally reported by graham.gower, Sep 21, 2010
-----------------------------------------------------------------------------
#1 denix0 (Aug 1, 2011)
Here&apos;s a start - patch to send &quot;Collected errors:&quot; reports to stderr.

Otherwise it&apos;s hard to deal with non-fatal errors (should they be warnings?) in scripts.

#2 paul.betafive (Sep 18, 2013)
The patch looks good, errors should definitely be printed to stderr not stdout. I&apos;ll try to get it applied for version 0.3.

Also, I disagree with Graham here. Error codes are better because they&apos;re simpler to handle in code that wants to know what error occurred (use &quot;==&quot; rather than &quot;strcmp&quot;). It also means a function opkg_strerror(int err) can eventually give the error in a local language, knowing that no sane code is going to run strcmp on it.

Maybe we need an error structure that can say what package or file caused the error code, something like:

    struct opkg_error {
        int     err;
        char *  cause;
    };

#3 paul.betafive (Feb 1, 2014)
Drop back to v0.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54318</commentid>
    <comment_count>1</comment_count>
      <attachid>2750</attachid>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-20 22:27:34 +0000</bug_when>
    <thetext>Created attachment 2750
send_collected_err_to_stderr</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62461</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2016-05-25 20:53:31 +0000</bug_when>
    <thetext>Additional info:
Packages which are listed as dependencies, but not included in any sources are still added to the dependency graph and passed to the solver. When opkg is built with libsolv, the solver errors-out - unable to find the depended package in the sources - and opkg throws up error code 1 and passes libsolv&apos;s message that

&quot;- package &lt;package&gt; does not exist&quot;

This is different from the behavior when opkg is asked to install a package which is unlisted in the sources (even as a dependency). In this case, opkg throws error 255 and delivers to the user the low-level message:

&quot; * opkg_prepare_url_for_install: Couldn&apos;t find anything to satisfy &apos;&lt;package&gt;&apos;.&quot;

These are, from the user&apos;s perspective, the same error; but they&apos;re delivered differently. From the developer&apos;s perspective, receiving the general errno 1 from the solver is unhelpful in handling the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82571</commentid>
    <comment_count>3</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-12-20 23:57:11 +0000</bug_when>
    <thetext>Re-targeting in preparation for 0.4 release</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2750</attachid>
            <date>2015-09-20 22:27:34 +0000</date>
            <delta_ts>2015-09-20 22:27:34 +0000</delta_ts>
            <desc>send_collected_err_to_stderr</desc>
            <filename>send-collected-err-to-stderr.patch</filename>
            <type>text/plain</type>
            <size>559</size>
            <attacher name="Alejandro del Castillo">alejandro.delcastillo</attacher>
            
              <data encoding="base64">ZGlmZiAtdU5yIG9wa2ctb3JpZy9saWJvcGtnL29wa2dfbWVzc2FnZS5jIG9wa2cvbGlib3BrZy9v
cGtnX21lc3NhZ2UuYwotLS0gb3BrZy1vcmlnL2xpYm9wa2cvb3BrZ19tZXNzYWdlLmMJMjAxMS0w
OC0wMSAxOTo0Nzo1MS45ODYwNjMyOTMgLTA0MDAKKysrIG9wa2cvbGlib3BrZy9vcGtnX21lc3Nh
Z2UuYwkyMDExLTA4LTAxIDE5OjQ5OjM4LjcxMzgzMzkyNSAtMDQwMApAQCAtNjQsMTAgKzY0LDEw
IEBACiAJc3RydWN0IGVycmxpc3QgKmVyciA9IGVycm9yX2xpc3RfaGVhZDsKIAogCWlmIChlcnIp
IHsKLQkJcHJpbnRmKCJDb2xsZWN0ZWQgZXJyb3JzOlxuIik7CisJCWZwcmludGYoc3RkZXJyLCAi
Q29sbGVjdGVkIGVycm9yczpcbiIpOwogCQkvKiBIZXJlIHdlIHByaW50IHRoZSBlcnJvcnMgY29s
bGVjdGVkIGFuZCBmcmVlIHRoZSBsaXN0ICovCiAJCXdoaWxlIChlcnIgIT0gTlVMTCkgewotCQkJ
cHJpbnRmKCIgKiAlcyIsIGVyci0+ZXJybXNnKTsKKwkJCWZwcmludGYoc3RkZXJyLCAiICogJXMi
LCBlcnItPmVycm1zZyk7CiAJCQllcnIgPSBlcnItPm5leHQ7CiAJCX0KIAl9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>