build.sh: more variables are local
							parent
							
								
									d8e7e8606f
								
							
						
					
					
						commit
						3559e47957
					
				
							
								
								
									
										12
									
								
								build.sh
								
								
								
								
							
							
						
						
									
										12
									
								
								build.sh
								
								
								
								
							| 
						 | 
					@ -27,7 +27,7 @@ test_program_installed() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# return 1 on found
 | 
					# return 1 on found
 | 
				
			||||||
test_programs_installed() {
 | 
					test_programs_installed() {
 | 
				
			||||||
    installed=0;
 | 
					    local installed=0;
 | 
				
			||||||
    $ECHO -n "Checking for all($*)..."
 | 
					    $ECHO -n "Checking for all($*)..."
 | 
				
			||||||
    for i in "$@" ;
 | 
					    for i in "$@" ;
 | 
				
			||||||
    do
 | 
					    do
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ exit_script() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ensure_program_installed() {
 | 
					ensure_program_installed() {
 | 
				
			||||||
    installed=0;
 | 
					    local installed=0;
 | 
				
			||||||
    $ECHO -n "Checking for any($*)..."
 | 
					    $ECHO -n "Checking for any($*)..."
 | 
				
			||||||
    for i in "$@" ;
 | 
					    for i in "$@" ;
 | 
				
			||||||
    do
 | 
					    do
 | 
				
			||||||
| 
						 | 
					@ -243,7 +243,7 @@ check_factor_exists() {
 | 
				
			||||||
find_os() {
 | 
					find_os() {
 | 
				
			||||||
    if [[ -n $OS ]] ; then return; fi
 | 
					    if [[ -n $OS ]] ; then return; fi
 | 
				
			||||||
    $ECHO "Finding OS..."
 | 
					    $ECHO "Finding OS..."
 | 
				
			||||||
    uname_s=$(uname -s)
 | 
					    local uname_s=$(uname -s)
 | 
				
			||||||
    check_ret uname
 | 
					    check_ret uname
 | 
				
			||||||
    case $uname_s in
 | 
					    case $uname_s in
 | 
				
			||||||
        CYGWIN_NT-5.2-WOW64) OS=windows;;
 | 
					        CYGWIN_NT-5.2-WOW64) OS=windows;;
 | 
				
			||||||
| 
						 | 
					@ -550,7 +550,7 @@ check_url() {
 | 
				
			||||||
            return 1
 | 
					            return 1
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    elif [[ $DOWNLOADER_NAME == 'curl' ]]; then
 | 
					    elif [[ $DOWNLOADER_NAME == 'curl' ]]; then
 | 
				
			||||||
        code=$(curl -sL -w "%{http_code}\\n" "$1" -o /dev/null)
 | 
					        local code=$(curl -sL -w "%{http_code}\\n" "$1" -o /dev/null)
 | 
				
			||||||
        if [[ $code -eq 200 ]]; then return 0; else return 1; fi
 | 
					        if [[ $code -eq 200 ]]; then return 0; else return 1; fi
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        $ECHO "error: wget or curl required in check_url"
 | 
					        $ECHO "error: wget or curl required in check_url"
 | 
				
			||||||
| 
						 | 
					@ -562,10 +562,10 @@ check_url() {
 | 
				
			||||||
# Otherwise, just use `master`
 | 
					# Otherwise, just use `master`
 | 
				
			||||||
set_boot_image_vars() {
 | 
					set_boot_image_vars() {
 | 
				
			||||||
    set_current_branch
 | 
					    set_current_branch
 | 
				
			||||||
    url="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/checksums.txt"
 | 
					    local url="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/checksums.txt"
 | 
				
			||||||
    check_url $url
 | 
					    check_url $url
 | 
				
			||||||
    if [[ $? -eq 0 ]]; then
 | 
					    if [[ $? -eq 0 ]]; then
 | 
				
			||||||
        CHECKSUM_URL="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/checksums.txt"
 | 
					        CHECKSUM_URL="$url"
 | 
				
			||||||
        BOOT_IMAGE_URL="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/${BOOT_IMAGE}"
 | 
					        BOOT_IMAGE_URL="http://downloads.factorcode.org/images/${CURRENT_BRANCH}/${BOOT_IMAGE}"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        CHECKSUM_URL="http://downloads.factorcode.org/images/master/checksums.txt"
 | 
					        CHECKSUM_URL="http://downloads.factorcode.org/images/master/checksums.txt"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue