repoman: dedent generated repos.conf
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Jun 2013 03:29:10 +0000 (20:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Jun 2013 03:29:10 +0000 (20:29 -0700)
This fixes a "File contains no section headers" error raised by
configparser with Python 2.

bin/repoman

index 610744910bcb571990ba64a660d92a04ff7dca15..2a3b4f30f3482b439a87ce7588a0f75986de9e36 100755 (executable)
@@ -590,10 +590,10 @@ except KeyError:
        if layout_conf_data['repo-name']:
                repo_name = layout_conf_data['repo-name']
        repos_conf_file = os.path.join(repoman_settings["PORTAGE_CONFIGROOT"], portage.const.USER_CONFIG_PATH, "repos.conf")
-       tmp_conf_file = io.StringIO("""
+       tmp_conf_file = io.StringIO(textwrap.dedent("""
                [%s]
                location = %s
-               """ % (repo_name, portdir_overlay))
+               """) % (repo_name, portdir_overlay))
        repositories = portage.repository.config.RepoConfigLoader([repos_conf_file, tmp_conf_file], repoman_settings)
        # We have to call the config constructor again so that attributes
        # dependent on config.repositories are initialized correctly.