Prevent CHOST vdb entries from being created for virtual packages.
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:17:52 +0000 (20:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:17:52 +0000 (20:17 -0000)
(trunk r15353)

svn path=/main/branches/2.1.7/; revision=15580

pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index 32a7902d3483e44723f4b24a0e33cdf9179c1719..1330263cb00b6f567a91e3f88ebbb10ca333df6b 100644 (file)
@@ -5865,6 +5865,9 @@ def _post_src_install_chost_fix(settings):
        CHOST variable, so revert it to the initial
        setting.
        """
+       if settings.get('CATEGORY') == 'virtual':
+               return
+
        chost = settings.get('CHOST')
        if chost:
                write_atomic(os.path.join(settings['PORTAGE_BUILDDIR'],
index 8f53b1f98085b66dec68536a1252864b5d5dee93..c2885b15c1468b152445c63500fea2d631d03d44 100644 (file)
@@ -2336,6 +2336,13 @@ class dblink(object):
 
                slot = ''
                for var_name in ('CHOST', 'SLOT'):
+                       if var_name == 'CHOST' and self.cat == 'virtual':
+                               try:
+                                       os.unlink(os.path.join(inforoot, var_name))
+                               except OSError:
+                                       pass
+                               continue
+
                        try:
                                val = codecs.open(_unicode_encode(
                                        os.path.join(inforoot, var_name),