<?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>12747</bug_id>
          
          <creation_ts>2018-05-14 19:07:46 +0000</creation_ts>
          <short_desc>PACKAGE_EXCLUDE should also be able to uninstall complementary packages</short_desc>
          <delta_ts>2018-10-17 01:46:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>jkrishnanjanappa</cc>
    
    <cc>manish.das</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80576</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-05-14 19:07:46 +0000</bug_when>
    <thetext>For now PACKAGE_EXCLUDE can only exclude packages that is in the initial installation list.
But what normal users would expect from PACKAGE_EXCLUDE is that as long as a package is listed in this variable and there&apos;s no dependency problem, it could be correctly excluded.

This requirement is from Yocto mailing list.
Some user wants to exclude acl-ptest package when has has enabled *-ptest complementary packages.
I realize that current implementation of PACKAGE_EXCLUDE cannot handle such situation.
I think we need to change this situation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81334</commentid>
    <comment_count>1</comment_count>
    <who name="Jagadeesh Krishnanjanappa">jkrishnanjanappa</who>
    <bug_when>2018-08-14 05:18:03 +0000</bug_when>
    <thetext>We have PACKAGE_EXCLUDE_COMPLEMENTARY to exclude complementary package from installing.

Adding below line in local.conf, prevents acl-ptest to be excluded.

PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl&quot;


Also, If PACKAGE_EXCLUDE = &quot;acl&quot; is used, then the installed packages list does not have acl entry (provided there is no package pulls in acl via RDEPENDS), and most likely the acl complementary packages are not installed without PACKAGE_EXCLUDE_COMPLEMENTARY setting.

Regards,
Jagadeesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81350</commentid>
    <comment_count>2</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-08-15 02:07:53 +0000</bug_when>
    <thetext>PACKAGE_EXCLUDE_COMPLEMENTARY can only exclude all complementary pkgs. What the user wants is exclude one of them. For example, the user wants acl-ptest to be excluded while all other complementary packages are installed.

In fact PACKAGE_EXCLUDE_COMPLEMENTARY works by &apos;not installing&apos; instead &apos;removing&apos;. That is, it takes effect at install time. In contrast, PACKAGE_EXCLUDE works as &apos;removing&apos;. That is, it takes effect by trying to remove some package.

I&apos;d like to copy the original email from yocto mailing list below. Please check.

I just checked the codes. I think the ref manual might be a little misleading.
&quot;Prevents specific packages from being installed when you are installing complementary packages. &quot;
might better be changed to:
&quot;Prevents specific packages to install their complementary packages. Items specified by this variable are considered as regular expression.&quot;
Maybe an example should follow.

So specifying value &apos;acl&apos; for PACKAGE_EXCLUDE_COMPLEMENTARY should be valid and its complementary packages should not be installed. Specifying &apos;acl.*&apos; should have the same effect, but &apos;acl.&apos; should not.

Anyway, I think you should file a bug with steps to reproduce the problem.

Also, I found that we currently don&apos;t have a mechanism to exclude some specific complementary package (e.g. acl-ptest in your case). We might need to reconsider what PACKAGE_EXCLUDE should mean.
More specifically, if a user requires *-ptest packages in general, but wants to exclude acl-ptest package, there&apos;s no easy way to do so.

Best Regards,
Chen Qi

On 05/09/2018 11:30 PM, Erik Nellessen wrote:
&gt; I would like to exclude some ptest packages from an image build.
&gt;
&gt; To include ptest packages in general, my image recipe contains the following line:
&gt; IMAGE_FEATURES_append = &quot; ptest-pkgs&quot;
&gt;
&gt; As a first step, I tried to exclude the acl-ptest package. To do so, I added the following to my image recipe:
&gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl-ptest&quot;
&gt;
&gt; I thought that this would exclude the acl-ptest package as described in the project reference: https://www.yoctoproject.org/docs/2.4.2/ref-manual/ref-manual.html#var-PACKAGE_EXCLUDE_COMPLEMENTARY
&gt; &quot;Prevents specific packages from being installed when you are installing complementary packages.
&gt;
&gt; You might find that you want to prevent installing certain packages when you are installing complementary packages. For example, if you are using IMAGE_FEATURES to install dev-pkgs, you might not want to install all packages from a particular multilib. If you find yourself in this situation, you can use the PACKAGE_EXCLUDE_COMPLEMENTARY variable to specify regular expressions to match the packages you want to exclude.&quot;
&gt;
&gt; Anyhow this did not result in an image without the acl-ptest package, as I could validate by having a look at the image&apos;s manifest file.
&gt;
&gt; When I changed the image recipe to contain the regular expression &quot;acl&quot;, i.e
&gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl&quot;
&gt; all three acl packages (acl, acl-lic, acl-ptest) were excluded from the image.
&gt;
&gt; And to really start the confusion, when changed the regular expression to &quot;acl.&quot;, i.e.
&gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl.&quot;
&gt; all three packages were also excluded.
&gt;
&gt; Now I am really confused. My expectation was that &quot;acl-ptest&quot; and &quot;acl&quot; would match the acl-ptest package name and &quot;acl.&quot; would not match the acl package name.
&gt;
&gt; Does anybody see what I am missing here?
&gt;
&gt; Thanks in advance,
&gt; Erik</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81361</commentid>
    <comment_count>3</comment_count>
    <who name="Jagadeesh Krishnanjanappa">jkrishnanjanappa</who>
    <bug_when>2018-08-15 15:19:06 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; PACKAGE_EXCLUDE_COMPLEMENTARY can only exclude all complementary pkgs. What
&gt; the user wants is exclude one of them. For example, the user wants acl-ptest
&gt; to be excluded while all other complementary packages are installed.
&gt; 
&gt; In fact PACKAGE_EXCLUDE_COMPLEMENTARY works by &apos;not installing&apos; instead
&gt; &apos;removing&apos;. That is, it takes effect at install time. In contrast,
&gt; PACKAGE_EXCLUDE works as &apos;removing&apos;. That is, it takes effect by trying to
&gt; remove some package.
&gt; 
&gt; I&apos;d like to copy the original email from yocto mailing list below. Please
&gt; check.
&gt; 
&gt; I just checked the codes. I think the ref manual might be a little
&gt; misleading.
&gt; &quot;Prevents specific packages from being installed when you are installing
&gt; complementary packages. &quot;
&gt; might better be changed to:
&gt; &quot;Prevents specific packages to install their complementary packages. Items
&gt; specified by this variable are considered as regular expression.&quot;
&gt; Maybe an example should follow.
&gt; 
&gt; So specifying value &apos;acl&apos; for PACKAGE_EXCLUDE_COMPLEMENTARY should be valid
&gt; and its complementary packages should not be installed. Specifying &apos;acl.*&apos;
&gt; should have the same effect, but &apos;acl.&apos; should not.
&gt; 

Basically, when &quot;acl&quot; is added into PACKAGE_EXCLUDE_COMPLEMENTARY, it gets added into skipval variable of scripts/oe-pkgdata-util. So the resulting skipval would be &apos;-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-|acl&apos;.
This value is used as a regular expression pattern to match/search complementary packages. That means any package which contains &quot;acl&quot; string, their corresponding complementary packages are excluded i.e acl and libacl1 complementary packages are excluded. 

That&apos;s the reason why acl,acl-dev,acl-dbg,acl-doc,acl-ptest etc.. are excluded when PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl&quot;.

This can be verified using below commands,

With acl in exclude:
oe-pkgdata-util -d -p /opt/work_jagadeesh/poky_master/build/tmp/pkgdata/qemux86 glob /tmp/inst *-ptest *-dev *-dbg --exclude=&quot;acl&quot; 2&gt;&amp;1 | grep acl
DEBUG: acl -&gt; !!
DEBUG: libacl1 -&gt; !!

In the above scenario, none of the acl complementary gets installed.

Without acl in exclude:
oe-pkgdata-util -d -p /opt/work_jagadeesh/poky_master/build/tmp/pkgdata/qemux86 glob /tmp/inst *-ptest *-dev *-dbg --exclude=&quot;acl-ptest&quot; 2&gt;&amp;1 | grep acl
DEBUG: acl (*-ptest) -&gt; acl-ptest
DEBUG: acl (*-dev) -&gt; acl-dev
DEBUG: acl (*-dbg) -&gt; acl-dbg
DEBUG: libacl1 (*-ptest) -&gt; acl-ptest
DEBUG: libacl1 (*-dev) -&gt; acl-dev
DEBUG: libacl1 (*-dbg) -&gt; acl-dbg

In the above scenario, acl-ptest, acl-dev, and acl-dbg gets installed.

&gt; Anyway, I think you should file a bug with steps to reproduce the problem.
&gt;
So the logic of regular expression in complementary package is correct.
 
&gt; Also, I found that we currently don&apos;t have a mechanism to exclude some
&gt; specific complementary package (e.g. acl-ptest in your case). We might need
&gt; to reconsider what PACKAGE_EXCLUDE should mean.
&gt; More specifically, if a user requires *-ptest packages in general, but wants
&gt; to exclude acl-ptest package, there&apos;s no easy way to do so.
&gt;
Actually if we want to exclude &quot;acl-ptest&quot;, then PACKAGE_EXCLUDE = &quot;acl-ptest&quot; will do the job.


Please let me know if queries.

Regards,
Jagadeesh 

&gt; Best Regards,
&gt; Chen Qi
&gt; 
&gt; On 05/09/2018 11:30 PM, Erik Nellessen wrote:
&gt; &gt; I would like to exclude some ptest packages from an image build.
&gt; &gt;
&gt; &gt; To include ptest packages in general, my image recipe contains the following line:
&gt; &gt; IMAGE_FEATURES_append = &quot; ptest-pkgs&quot;
&gt; &gt;
&gt; &gt; As a first step, I tried to exclude the acl-ptest package. To do so, I added the following to my image recipe:
&gt; &gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl-ptest&quot;
&gt; &gt;
&gt; &gt; I thought that this would exclude the acl-ptest package as described in the project reference: https://www.yoctoproject.org/docs/2.4.2/ref-manual/ref-manual.html#var-PACKAGE_EXCLUDE_COMPLEMENTARY
&gt; &gt; &quot;Prevents specific packages from being installed when you are installing complementary packages.
&gt; &gt;
&gt; &gt; You might find that you want to prevent installing certain packages when you are installing complementary packages. For example, if you are using IMAGE_FEATURES to install dev-pkgs, you might not want to install all packages from a particular multilib. If you find yourself in this situation, you can use the PACKAGE_EXCLUDE_COMPLEMENTARY variable to specify regular expressions to match the packages you want to exclude.&quot;
&gt; &gt;
&gt; &gt; Anyhow this did not result in an image without the acl-ptest package, as I could validate by having a look at the image&apos;s manifest file.
&gt; &gt;
&gt; &gt; When I changed the image recipe to contain the regular expression &quot;acl&quot;, i.e
&gt; &gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl&quot;
&gt; &gt; all three acl packages (acl, acl-lic, acl-ptest) were excluded from the image.
&gt; &gt;
&gt; &gt; And to really start the confusion, when changed the regular expression to &quot;acl.&quot;, i.e.
&gt; &gt; PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;acl.&quot;
&gt; &gt; all three packages were also excluded.
&gt; &gt;
&gt; &gt; Now I am really confused. My expectation was that &quot;acl-ptest&quot; and &quot;acl&quot; would match the acl-ptest package name and &quot;acl.&quot; would not match the acl package name.
&gt; &gt;
&gt; &gt; Does anybody see what I am missing here?
&gt; &gt;
&gt; &gt; Thanks in advance,
&gt; &gt; Erik</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81362</commentid>
    <comment_count>4</comment_count>
    <who name="Jagadeesh Krishnanjanappa">jkrishnanjanappa</who>
    <bug_when>2018-08-15 15:26:53 +0000</bug_when>
    <thetext>Further to comment 3:

Without acl:
oe-pkgdata-util -d -p /opt/work_jagadeesh/poky_master/build/tmp/pkgdata/qemux86 glob /tmp/inst *-ptest *-dev *-dbg 2&gt;&amp;1 | grep acl
DEBUG: acl (*-ptest) -&gt; acl-ptest
DEBUG: acl (*-dev) -&gt; acl-dev
DEBUG: acl (*-dbg) -&gt; acl-dbg
DEBUG: libacl1 (*-ptest) -&gt; acl-ptest
DEBUG: libacl1 (*-dev) -&gt; acl-dev
DEBUG: libacl1 (*-dbg) -&gt; acl-dbg
acl-dev
acl-dbg
acl-ptest

In the above scenario, acl-ptest, acl-dev, and acl-dbg gets installed.

Regards,
Jagadeesh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81373</commentid>
    <comment_count>5</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-08-16 01:59:27 +0000</bug_when>
    <thetext>You are right.
I think we can close this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81885</commentid>
    <comment_count>6</comment_count>
    <who name="Manish Das">manish.das</who>
    <bug_when>2018-10-17 01:34:52 +0000</bug_when>
    <thetext>As a test, below is observation for connman  package with PACKAGE_EXCLUDE and PACKAGE_EXCLUDE_COMPLEMENTARY:

1. It is removing all connman package (connman, connman-dev, connman-dbg etc.) as per mentione below  in local.conf

EXTRA_IMAGE_FEATURES_append = &quot; dev-pkgs dbg-pkgs&quot;
IMAGE_INSTALL_append = &quot; connman&quot;

PACKAGE_EXCLUDE = &quot;connman&quot;

2. It removing only mentioned connman package e.i. connman-dev as per mentioned below in local.conf

EXTRA_IMAGE_FEATURES_append = &quot; dev-pkgs dbg-pkgs&quot;
IMAGE_INSTALL_append = &quot; connman&quot;

PACKAGE_EXCLUDE = &quot;connman-dev&quot;


3. It is removing complementary packages of connman (connman-dev, connman-dbg). It will not remove main connman package (connman) ,as per mentioned below in local.conf

EXTRA_IMAGE_FEATURES_append = &quot; dev-pkgs dbg-pkgs&quot;
IMAGE_INSTALL_append = &quot; connman&quot;

PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;connman&quot;


4. It is removing complementary packages of connman (connman-dev, connman-dbg). It will not remove main connman package (connman) ,as per mentioned below in local.conf

EXTRA_IMAGE_FEATURES_append = &quot; dev-pkgs dbg-pkgs&quot;
IMAGE_INSTALL_append = &quot; connman&quot;

PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;connman-*&quot;


5. It is installing all packages of connman (connman, connman-dev, connman-dbg) as per mentioned below in local.conf
EXTRA_IMAGE_FEATURES_append = &quot; dev-pkgs dbg-pkgs&quot;
IMAGE_INSTALL_append = &quot; connman&quot;

PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;connman-dbg&quot;
OR
PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;connman-dev&quot;


Conclusion as per above testing:

PACKAGE_EXCLUDE_COMPLEMENTARY: It will remove  only all complementary packages like (-dbg,-dev etc..) of a sepcified package name but it will not remove the main package(&apos;conman&apos; as per above example).
And it works with regular expression also i.e  PACKAGE_EXCLUDE_COMPLEMENTARY = &quot;connman-*&quot; By this regular expression it removes only complementray package. 

PACKAGE_EXCLUDE: It removes all packages of specified package with PACKAGE_EXCLUDE if we want to exclude specific complimentary package(-dbg,-dev etc..) we need to mention  the name of complementary  package 
For  example to remove complementary  &quot;connman-dev&quot; package of connman write like this ( PACKAGE_EXCLUDE = &quot;connman-dev&quot;)
if we mention  as PACKAGE_EXCLUDE = &quot;connnman&quot; then it will remove  all main package(connman as per this example) as well as complementary package also (like connnman-dev,connnman-dbg etc)

In the light of the observations, Chen Qi may proceed to close the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81886</commentid>
    <comment_count>7</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2018-10-17 01:46:34 +0000</bug_when>
    <thetext>Close this bug as there&apos;s no problem in current product.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>