mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fix a bug in Python build scripts where an extra ending slash in the
build directory would cause REV_BUILD_DIR to be set incorrectly and would lead to a broken Makefile being generated. What would happen before: ``` $ python scripts/mk_make.py --build FOO_1 ... REV_BUILD_DIR='..' ``` ``` $ python scripts/mk_make.py --build FOO_1/ ... REV_BUILD_DIR='../..' ``` ^^^^^ that's wrong. It should be REV_BUILD_DIR='..' To fix this the ``reverse_path()`` function has been taught to ignore empty components in ``p.split(os.sep)``.
This commit is contained in:
		
							parent
							
								
									33f676ef6b
								
							
						
					
					
						commit
						508d2e32c8
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -742,7 +742,8 @@ def extract_c_includes(fname):
 | 
			
		|||
 | 
			
		||||
# Given a path dir1/subdir2/subdir3 returns ../../..
 | 
			
		||||
def reverse_path(p):
 | 
			
		||||
    l = p.split(os.sep)
 | 
			
		||||
    # Filter out empty components (e.g. will have one if path ends in a slash)
 | 
			
		||||
    l = list(filter(lambda x: len(x) > 0, p.split(os.sep)))
 | 
			
		||||
    n = len(l)
 | 
			
		||||
    r = '..'
 | 
			
		||||
    for i in range(1, n):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue