mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 02:15:45 +01:00 
			
		
		
		
	patman: Avoid importing gitutil in settings
Pass this module in so that settings does not need to import it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
This commit is contained in:
		| @@ -80,7 +80,7 @@ specified by tags you place in the commits. Use -n to do a dry run first.""" | |||||||
| # Parse options twice: first to get the project and second to handle | # Parse options twice: first to get the project and second to handle | ||||||
| # defaults properly (which depends on project). | # defaults properly (which depends on project). | ||||||
| (options, args) = parser.parse_args() | (options, args) = parser.parse_args() | ||||||
| settings.Setup(parser, options.project, '') | settings.Setup(gitutil, parser, options.project, '') | ||||||
| (options, args) = parser.parse_args() | (options, args) = parser.parse_args() | ||||||
|  |  | ||||||
| if __name__ != "__main__": | if __name__ != "__main__": | ||||||
|   | |||||||
| @@ -11,7 +11,6 @@ import os | |||||||
| import re | import re | ||||||
|  |  | ||||||
| from patman import command | from patman import command | ||||||
| from patman import gitutil |  | ||||||
| from patman import tools | from patman import tools | ||||||
|  |  | ||||||
| """Default settings per-project. | """Default settings per-project. | ||||||
| @@ -185,7 +184,7 @@ def ReadGitAliases(fname): | |||||||
|  |  | ||||||
|     fd.close() |     fd.close() | ||||||
|  |  | ||||||
| def CreatePatmanConfigFile(config_fname): | def CreatePatmanConfigFile(gitutil, config_fname): | ||||||
|     """Creates a config file under $(HOME)/.patman if it can't find one. |     """Creates a config file under $(HOME)/.patman if it can't find one. | ||||||
|  |  | ||||||
|     Args: |     Args: | ||||||
| @@ -301,7 +300,7 @@ def GetItems(config, section): | |||||||
|     except: |     except: | ||||||
|         raise |         raise | ||||||
|  |  | ||||||
| def Setup(parser, project_name, config_fname=''): | def Setup(gitutil, parser, project_name, config_fname=''): | ||||||
|     """Set up the settings module by reading config files. |     """Set up the settings module by reading config files. | ||||||
|  |  | ||||||
|     Args: |     Args: | ||||||
| @@ -318,7 +317,7 @@ def Setup(parser, project_name, config_fname=''): | |||||||
|  |  | ||||||
|     if not os.path.exists(config_fname): |     if not os.path.exists(config_fname): | ||||||
|         print("No config file found ~/.patman\nCreating one...\n") |         print("No config file found ~/.patman\nCreating one...\n") | ||||||
|         CreatePatmanConfigFile(config_fname) |         CreatePatmanConfigFile(gitutil, config_fname) | ||||||
|  |  | ||||||
|     config.read(config_fname) |     config.read(config_fname) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user