mirror of
				https://github.com/optim-enterprises-bv/openwrt-ipq.git
				synced 2025-11-04 04:08:34 +00:00 
			
		
		
		
	scripts/kernel_bump: Use the git index to find the needed config files
The current solution using `find` introduces a racecondition, where `find` and `git mv` get in each others way. While this could be fixed with more-utils sponge command (or even sort -u) to buffer the output of find. However, a much better approach, is to query the git index directly, which will not change, and is far more accurate. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
This commit is contained in:
		
				
					committed by
					
						
						Robert Marko
					
				
			
			
				
	
			
			
			
						parent
						
							8ed187e471
						
					
				
				
					commit
					b62aafc99a
				
			@@ -137,9 +137,15 @@ bump_kernel()
 | 
				
			|||||||
		done
 | 
							done
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	find "${_target_dir}" -iname "config-${source_version}" | while read -r _config; do
 | 
						for _config in $(git ls-files "${_target_dir}" |
 | 
				
			||||||
		_path="${_config%%"/config-${source_version}"}"
 | 
						                 sed -n "s|^\(.*config-${source_version}\).*|\1|p" |
 | 
				
			||||||
		git mv "${_config}" "${_path}/config-${target_version}"
 | 
						                 sort -u); do
 | 
				
			||||||
 | 
							if [ ! -e "${_config}" ]; then
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							_subtarget="${_config%%"/config-${source_version}"}"
 | 
				
			||||||
 | 
							git mv "${_config}" "${_subtarget}/config-${target_version}"
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	git commit \
 | 
						git commit \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user