Skip to content

topology: pre-processor: support to include conf block with IncludeByKey - #187

Closed
ranj063 wants to merge 1 commit into
alsa-project:masterfrom
ranj063:pr9
Closed

topology: pre-processor: support to include conf block with IncludeByKey#187
ranj063 wants to merge 1 commit into
alsa-project:masterfrom
ranj063:pr9

Conversation

@ranj063

@ranj063 ranj063 commented Jan 20, 2023

Copy link
Copy Markdown
Contributor

Currently, The IncludeByKey mechanism only supports conditionally including a topology conf file. Even if we only
want to conditionally include a small conf block, we have to use a conf file and in the end we will have a lot of trivial conf files that only contain a single conf blocks.

This patch extends the use of IncludeByKey ito support including conf blocks conditionally. For example, the block below will include the route conditionally based on the variable definition COPIER_ROUTE.

Define {
COPIER_ROUTE 1
}

IncludeByKey.COPIER_ROUTE {
"1" "Object.Base.route.11 {
source copier.module.8.2
sink copier.module.17.2
}"
}

Signed-off-by: Chao Song chao.song@linux.intel.com
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com

@perexg

perexg commented Jan 23, 2023

Copy link
Copy Markdown
Member

I think that it would be much cleaner to support this syntax (eliminate " or ' character escaping and avoid the ".conf" suffix check):

Define {
  COPIER_ROUTE 1
}

IncludeByKey.COPIER_ROUTE {
  "1" {
      Object.Base.route.11 {
        source copier.module.8.2
        sink copier.module.17.2
      }
   }
}

A quickly created code (untested):

perexg@a6053ea

Currently, The IncludeByKey mechanism only supports conditionally
including a topology conf file. Even if we only
want to conditionally include a small conf block, we have
to use a conf file and in the end we will have a lot of
trivial conf files that only contain a single conf blocks.

This patch extends the use of IncludeByKey ito support including conf
blocks conditionally. For example, the block below will include the route
conditionally based on the variable definition COPIER_ROUTE.

Define {
	COPIER_ROUTE	1
}

IncludeByKey.COPIER_ROUTE {
       	"1" {
		Object.Base.route.11 {
			source	copier.module.8.2
			sink	copier.module.17.2
		}
	    }
}

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063

ranj063 commented Jan 23, 2023

Copy link
Copy Markdown
Contributor Author

A quickly created code (untested):

perexg@a6053ea

@perexg this works like a charm. Updated the PR Now. Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants