<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>144333</bug_id>
          
          <creation_ts>2006-08-18 09:58 0000</creation_ts>
          <short_desc>--changeduse and --newuse as dynamic package sets.</short_desc>
          <delta_ts>2007-06-29 02:52:16 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Portage Development</product>
          <component>Enhancement/Feature Requests</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P5</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>181949</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>renrutal@gmail.com</reporter>
          <assigned_to>dev-portage@gentoo.org</assigned_to>
          <cc>arfrever@gentoo.org</cc>
    
    <cc>esigra@gmail.com</cc>
    
    <cc>pacho@condmat1.ciencias.uniovi.es</cc>

      

      
          <long_desc isprivate="0">
            <who>renrutal@gmail.com</who>
            <bug_when>2006-08-18 09:58:39 0000</bug_when>
            <thetext>--newuse default action is to emerge apps which USE flags have been changed. However, this will also reemerge packages even if you didn&apos;t change their flags.

I propose a new option to be used with --newuse: --changeduse. It will emerge the packages with new uses AND with USE flags the system admin modified.

Resuming:
--newuse: (Re)emerges the packages with USEs marked as % and *
--newuse --changeduse: (Re)emerges the packages with USEs marked only as *


Another enhancement that could be considered is giving --newuse a new behavior:

--newuse: Only emerges packages with *
--newuse --anewoption: * and %

It all depends if % changes are really required while reemerging a system. IMHO, * is more important.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-08-18 13:44:58 0000</bug_when>
            <thetext>IUSE records the flags that affect a given package.  When the package version remains unchanged, a % symbol reflects a change in IUSE.  It&apos;s possible that % and * may overlap for a given flag.  There a many different types of interactions that can happen it&apos;s not possible for portage to determine exactly where % and * overlap and where they do not.  Thus, portage does not attempt to make that distinction.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>renrutal@gmail.com</who>
            <bug_when>2006-08-18 19:56:34 0000</bug_when>
            <thetext>So if % and * and maybe other types interactions may overlap each other, does that mean they are stored in the same variable/place, even if represent different things?
Maybe Portage doesn&apos;t need to make distinctions because there aren&apos;t any to be done. One IUSE can be fresh, and it can be a newly set IUSE, so %* at the same time.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-08-18 20:24:30 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; So if % and * and maybe other types interactions may overlap each other, does
&gt; that mean they are stored in the same variable/place, even if represent
&gt; different things?

Yes, and sometimes the information isn&apos;t even stored at all.  For example, USE flag can affect an ebuild even when it&apos;s not listed in IUSE (though it&apos;s a QA violation, many ebuilds don&apos;t properly specify IUSE).

&gt; Maybe Portage doesn&apos;t need to make distinctions because there aren&apos;t any to be
&gt; done. One IUSE can be fresh, and it can be a newly set IUSE, so %* at the same
&gt; time.

I&apos;m not sure what you mean.  It&apos;s best expressed in terms of IUSE and USE.  These values can be examined via the metadata function of portageq.  For example:

portageq metadata / ebuild sys-apps/portage-2.1-r2 IUSE
portageq metadata / installed sys-apps/portage-2.1-r2 IUSE
portageq metadata / installed sys-apps/portage-2.1-r2 USE

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>genone@gentoo.org</who>
            <bug_when>2006-08-18 21:55:35 0000</bug_when>
            <thetext>The important thing to note here is that if a flag is added to or removed from IUSE portage can&apos;t know what happened:
a) a feature that was hard enabled became optional (so the package changes if the flag is not set in USE)
b) a new optional feature was added (so the package changes if the flag is set in USE)
c) an optional feature is now hard enabled (see a)
d) an optional feature was dropped (see b)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>renrutal@gmail.com</who>
            <bug_when>2006-08-18 23:17:20 0000</bug_when>
            <thetext>Thanks for the explanation, now I get the whole difference between USE and IUSE.

So, in terms of set theory:

A is a set of IUSE of a currently installed version of the package.
B is a set of IUSE of a the version of the package to be installed.

W = B - A
X = A - B

if W is not empty then it contains the new IUSE.
if X is not empty then it contains the dropped IUSE.

--newuse takes care of the cases above.

------

C is the USE set of the moment when the current installed package was emerged.
D is the USE set now.

E = A intersects C (the enabled IUSE back then)
F = B intersects D (the enabled IUSE now)

Y = F - E
Z = E - F

if Y is not empty then it contains the now enabled IUSE.
if Z is not empty then it contains the now disabled IUSE.

So, if an IUSE was added or dropped, but it wasn&apos;t enabled in USE, then there won&apos;t be changes, and it won&apos;t need a recompilation.

--changeduse takes care of these.

Now I just need to find out if Portage keeps track of enabled IUSE for each installed package.


The change from optional to required dependency and vice-versa isn&apos;t treated here, these changes should generate a new ebuild version, at least a new release (-r{DIGIT}). Portage will grab them and just update, even if it&apos;s not needed. Usually this kind of change is big enough to get its own version, isn&apos;t it?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-08-19 00:01:52 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; Now I just need to find out if Portage keeps track of enabled IUSE for each
&gt; installed package.

They&apos;re stored in /var/db/pkg/*/*/IUSE and retrievable via the portageq command that I mentioned earlier.

&gt; The change from optional to required dependency and vice-versa isn&apos;t treated
&gt; here, these changes should generate a new ebuild version, at least a new
&gt; release (-r{DIGIT}). Portage will grab them and just update, even if it&apos;s not
&gt; needed. Usually this kind of change is big enough to get its own version, isn&apos;t
&gt; it?

Ideally, yes.  However, I&apos;m pretty sure that the behavior of gentoo devs often isn&apos;t ideal.  In addition, a change in an eclass can affect all the ebuilds that inherit it.  In that case it may not be feasible to revbump all of the affected ebuilds.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-08-19 00:59:36 0000</bug_when>
            <thetext>Sure, we can always add yet another command line option, but perhaps things like --newuse and --changeduse really belong in the realm of packages sets (bug 96088).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-02-06 00:06:22 0000</bug_when>
            <thetext>*** Bug 151337 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>genone@gentoo.org</who>
            <bug_when>2007-06-23 18:51:13 0000</bug_when>
            <thetext>(In reply to comment #7)
&gt; Sure, we can always add yet another command line option, but perhaps things
&gt; like --newuse and --changeduse really belong in the realm of packages sets (bug
&gt; 96088).

That would likely need sets that can accept arguments and a more complex return type than just atoms (or can we use use-deps for that?).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2007-06-24 19:25:45 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; That would likely need sets that can accept arguments and a more complex return
&gt; type than just atoms (or can we use use-deps for that?).

Well, --newuse and --changeduse aren&apos;t really sets by themselves.  They&apos;re actually package selection modifiers that are applied to normal sets.  The --deep and --emptytree modifiers are other examples of this.  These package selection modifiers are hardcoded into the current resolver but eventually they&apos;ll be split out into separate modules.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2007-06-27 04:28:11 0000</bug_when>
            <thetext>Created an attachment (id=123176)
portage-2.1.3_rc5 patch adding support for --reinstall=changed-use

This implements a --reinstall=changed-use option which behaves like the --changeduse option described in comment #5.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2007-06-29 02:52:16 0000</bug_when>
            <thetext>This has been released in 2.1.3_rc6.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123176</attachid>
            <date>2007-06-27 04:28 0000</date>
            <desc>portage-2.1.3_rc5 patch adding support for --reinstall=changed-use</desc>
            <filename>changed-use.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IGJpbi9lbWVyZ2UKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gYmluL2VtZXJnZQkocmV2aXNpb24gNzA1
MikKKysrIGJpbi9lbWVyZ2UJKHJldmlzaW9uIDcwNTMpCkBAIC0zNDIsNiArMzQyLDcgQEAKIAlz
dWI9W10KIAlpZiAiLS11cGRhdGUiIGluIG15b3B0cyBvciBcCiAJCSItLW5ld3VzZSIgaW4gbXlv
cHRzIG9yIFwKKwkJIi0tcmVpbnN0YWxsIiBpbiBteW9wdHMgb3IgXAogCQkiLS1ub3JlcGxhY2Ui
IGluIG15b3B0cyBvciBcCiAJCW15YWN0aW9uIGluICgic3lzdGVtIiwgIndvcmxkIik6CiAJCWFk
ZC5leHRlbmQoWyJzZWxlY3RpdmUiXSkKQEAgLTEwNDAsNiArMTA0MSwyMSBAQAogCQlmLmVuZF9w
YXJhZ3JhcGgoMSkKIAkJZi53cml0ZXIuZmx1c2goKQogCisJZGVmIF9yZWluc3RhbGxfZm9yX2Zs
YWdzKHNlbGYsIGZvcmNlZF9mbGFncywKKwkJb3JpZ191c2UsIG9yZ19pdXNlLCBjdXJfdXNlLCBj
dXJfaXVzZSk6CisJCWlmICItLW5ld3VzZSIgaW4gc2VsZi5teW9wdHM6CisJCQlpZiBvcmdfaXVz
ZS5zeW1tZXRyaWNfZGlmZmVyZW5jZSgKKwkJCQljdXJfaXVzZSkuZGlmZmVyZW5jZShmb3JjZWRf
ZmxhZ3MpOgorCQkJCXJldHVybiBUcnVlCisJCQllbGlmIG9yZ19pdXNlLmludGVyc2VjdGlvbihv
cmlnX3VzZSkgIT0gXAorCQkJCWN1cl9pdXNlLmludGVyc2VjdGlvbihjdXJfdXNlKToKKwkJCQly
ZXR1cm4gVHJ1ZQorCQllbGlmICJ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