BitBake 中的“:=”和“.=”赋值有什么区别?

时间:2020-12-29 03:03:04

标签: bitbake

我在 BitBake .conf 文件中看到:

BBPATH := "${TOPDIR}"  

BBPATH .= ":${LAYERDIR}"  

:=.= 有什么区别?

2 个答案:

答案 0 :(得分:2)

根据BitBake manual

<块引用>

null 运算符会导致变量的内容立即展开。
如果您想在不插入空格的情况下附加或预先添加值,请使用 :=.= 运算符。

答案 1 :(得分:2)

正如人们所指出的,Bitbake 配置文件不使用常规的 shell 脚本语法。 Bitbake 有自己的配置语言。 (它被描述为“类似于其他几种语言”,但差异足够大,您无法从(比如)Bash 推断出 Bitbake 语义。)

有关更多信息,请阅读 Bitbake 用户手册。相关部分是Section 3.1 - Basic Syntax

说明:

  • @PutMapping("customers/{customerId}") public Customer updateCustomer(@RequestBody Customer newCustomer, @PathVariable Long customerId) throws ResourceNotFoundException { return customerRepo.findById(customerId) .map(customer -> { if (newCustomer.getName() != null) customer.setName(newCustomer.getName()); if (newCustomer.getGstin() != null) customer.setGstin(newCustomer.getGstin()); if (newCustomer.getPhoneNumber() != null) customer.setPhoneNumber(newCustomer.getPhoneNumber()); if (newCustomer.getAddress() != null) customer.setAddress(newCustomer.getAddress()); if (newCustomer.getOutstandingBalance() != 0.0f) customer.setOutstandingBalance(newCustomer.getOutstandingBalance()); return customerRepo.save(customer); }).orElseThrow( () ->new ResourceNotFoundException()); } 在 RHS 上执行立即(配置解析时间)变量扩展。相比之下,在 2020-12-29 08:36:04.789 INFO 2564 --- [ main] c.e.c.controller.CrudControllerTest : Starting CrudControllerTest using Java 11.0.9 on Acer-Aspire7 with PID 2564 (started by Ashil in C:\Users\Ashil\Documents\Java+SpringBoot\crudRestApi) 2020-12-29 08:36:04.792 INFO 2564 --- [ main] c.e.c.controller.CrudControllerTest : No active profile set, falling back to default profiles: default 2020-12-29 08:36:06.607 INFO 2564 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-12-29 08:36:07.103 INFO 2564 --- [ main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet '' 2020-12-29 08:36:07.103 INFO 2564 --- [ main] o.s.t.web.servlet.TestDispatcherServlet : Initializing Servlet '' 2020-12-29 08:36:07.106 INFO 2564 --- [ main] o.s.t.web.servlet.TestDispatcherServlet : Completed initialization in 3 ms 2020-12-29 08:36:07.155 INFO 2564 --- [ main] c.e.c.controller.CrudControllerTest : Started CrudControllerTest in 2.943 seconds (JVM running for 5.294) MockHttpServletRequest: HTTP Method = PUT Request URI = /customers/1 Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"39"] Body = { "name" : "test", "address" : "test" } Session Attrs = {} Handler: Type = com.example.crudrestapi.controller.CrudController Method = com.example.crudrestapi.controller.CrudController#updateCustomer(Customer, Long) Async: Async started = false Async result = null Resolved Exception: Type = java.lang.IllegalStateException ModelAndView: View name = null View = null Model = null FlashMap: Attributes = null MockHttpServletResponse: Status = 404 Error message = null Headers = [Content-Type:"text/plain;charset=UTF-8", Content-Length:"18"] Content type = text/plain;charset=UTF-8 Body = Resource Not Found Forwarded URL = null Redirected URL = null Cookies = [] java.lang.AssertionError: Status expected:<200> but was:<404> Expected :200 Actual :404 <Click to see difference> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:627) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:196) at com.example.crudrestapi.controller.CrudControllerTest.putApiTest(CrudControllerTest.java:85) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) 2020-12-29 08:36:07.506 INFO 2564 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' Process finished with exit code -1 中,扩展被延迟。

  • := 在现有值和附加值之间没有空格的情况下执行附加。这也是立即完成的。

相关问题