mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	Merge pull request #4823 from gurevichmark/copycds_name_with_dot
Better handling multiple dots in copycds name
This commit is contained in:
		@@ -469,13 +469,25 @@ sub get_file_name {
 | 
			
		||||
    elsif (($genos) && (-r "$searchpath/$profile.$genos.$extension")) {
 | 
			
		||||
        return "$searchpath/$profile.$genos.$extension";
 | 
			
		||||
    }
 | 
			
		||||
    elsif (-r "$searchpath/$profile.$osbase.$arch.$extension") {
 | 
			
		||||
        return "$searchpath/$profile.$osbase.$arch.$extension";
 | 
			
		||||
    # If the osimge name was specified with -n, the name might contain multiple "."
 | 
			
		||||
    # Chop them off one at a time until filename match is found
 | 
			
		||||
    else {
 | 
			
		||||
        while ($dotpos > 0) {
 | 
			
		||||
 | 
			
		||||
            if (-r "$searchpath/$profile.$osbase.$arch.$extension") {
 | 
			
		||||
                return "$searchpath/$profile.$osbase.$arch.$extension";
 | 
			
		||||
            }
 | 
			
		||||
            elsif (-r "$searchpath/$profile.$osbase.$extension") {
 | 
			
		||||
                return "$searchpath/$profile.$osbase.$extension";
 | 
			
		||||
            }
 | 
			
		||||
            # Chop off "." from the end and try again
 | 
			
		||||
            $dotpos = rindex($osbase, ".");
 | 
			
		||||
            $osbase = substr($osbase, 0, $dotpos);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    elsif (-r "$searchpath/$profile.$osbase.$extension") {
 | 
			
		||||
        return "$searchpath/$profile.$osbase.$extension";
 | 
			
		||||
    }
 | 
			
		||||
    elsif (-r "$searchpath/$profile.$arch.$extension") {
 | 
			
		||||
 | 
			
		||||
    # No file matching OS name was found, next try just arch, if still nothing -> default to just profile
 | 
			
		||||
    if (-r "$searchpath/$profile.$arch.$extension") {
 | 
			
		||||
        return "$searchpath/$profile.$arch.$extension";
 | 
			
		||||
    }
 | 
			
		||||
    elsif (-r "$searchpath/$profile.$extension") {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user