Automatically enable FEATURES=metadata-transfer if it's not enabled,
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:53:38 +0000 (06:53 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:53:38 +0000 (06:53 -0000)
instead of bailing out. (trunk r13265)

svn path=/main/branches/2.1.6/; revision=13444

bin/egencache

index 4d0f5c9a1d3c3f887e7b39ad951be96ac972a54a..3c48946121b5fb3c907cbd2d25ee2b681269d86b 100755 (executable)
@@ -243,10 +243,14 @@ def egencache_main(args):
                target_root='/', env=env)
 
        if 'metadata-transfer' not in settings.features:
-               writemsg_level("ecachegen: error: " + \
-                       "FEATURES=metadata-transfer is not enabled\n",
-                       level=logging.ERROR, noiselevel=-1)
-               return 1
+               writemsg_level("ecachegen: warning: " + \
+                       "automatically enabling FEATURES=metadata-transfer\n",
+                       level=logging.WARNING, noiselevel=-1)
+               settings.features.add('metadata-transfer')
+               settings['FEATURES'] = ' '.join(sorted(settings.features))
+               settings.backup_changes('FEATURES')
+
+       settings.lock()
 
        portdb = portage.portdbapi(settings["PORTDIR"], mysettings=settings)