]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - debian/patches/settings_ini
Add patch for missing config section in settings.ini from upstream
[deb_pkgs/autorandr.git] / debian / patches / settings_ini
index 65f6891b9a09502a3189dff16f485da29ee5c77b..22279623b171dc3e948416c47db72000b193d9f3 100644 (file)
@@ -45,7 +45,7 @@
      return configuration
  
  
-@@ -1002,6 +1013,14 @@
+@@ -1002,6 +1013,15 @@
              X11_displays_done.add(display)
  
  
 +    the options dictionary"""
 +    config = configparser.ConfigParser()
 +    config.read(os.path.join(directory, "settings.ini"))
-+    for key, value in config.items("config"):
-+        options.setdefault("--%s" % key, value)
++    if config.has_section("config"):
++        for key, value in config.items("config"):
++            options.setdefault("--%s" % key, value)
 +
  def main(argv):
      try:
          opts, args = getopt.getopt(argv[1:], "s:r:l:d:cfh",
-@@ -1040,6 +1059,7 @@
+@@ -1040,6 +1060,7 @@
              if os.path.isdir(system_profile_path):
                  profiles.update(load_profiles(system_profile_path))
                  profile_symlinks.update(get_symlinks(system_profile_path))
@@ -68,7 +69,7 @@
          # For the user's profiles, prefer the legacy ~/.autorandr if it already exists
          # profile_path is also used later on to store configurations
          profile_path = os.path.expanduser("~/.autorandr")
-@@ -1049,6 +1069,7 @@
+@@ -1049,6 +1070,7 @@
          if os.path.isdir(profile_path):
              profiles.update(load_profiles(profile_path))
              profile_symlinks.update(get_symlinks(profile_path))