fetch_tarballs.sh (b268bdc8) | fetch_tarballs.sh (e4af8f11) |
---|---|
1#!/usr/bin/env bash | 1#!/bin/sh |
2#************************************************************** 3# 4# Licensed to the Apache Software Foundation (ASF) under one 5# or more contributor license agreements. See the NOTICE file 6# distributed with this work for additional information 7# regarding copyright ownership. The ASF licenses this file 8# to you under the Apache License, Version 2.0 (the 9# "License"); you may not use this file except in compliance --- 102 unchanged lines hidden (view full) --- 112logfile=$TARFILE_LOCATION/fetch.log 113date >> $logfile 114 115# Create and go to a temporary directory under the tar file destination. 116mkdir -p $TARFILE_LOCATION/tmp 117cd $TARFILE_LOCATION/tmp 118 119 | 2#************************************************************** 3# 4# Licensed to the Apache Software Foundation (ASF) under one 5# or more contributor license agreements. See the NOTICE file 6# distributed with this work for additional information 7# regarding copyright ownership. The ASF licenses this file 8# to you under the Apache License, Version 2.0 (the 9# "License"); you may not use this file except in compliance --- 102 unchanged lines hidden (view full) --- 112logfile=$TARFILE_LOCATION/fetch.log 113date >> $logfile 114 115# Create and go to a temporary directory under the tar file destination. 116mkdir -p $TARFILE_LOCATION/tmp 117cd $TARFILE_LOCATION/tmp 118 119 |
120function basename () | 120basename () |
121{ 122 echo $1 | sed "s/^\(.*\/\)//" 123} 124 125 126# 127# Download a file from a URL and add its md5 checksum to its name. 128# | 121{ 122 echo $1 | sed "s/^\(.*\/\)//" 123} 124 125 126# 127# Download a file from a URL and add its md5 checksum to its name. 128# |
129function download () | 129download () |
130{ 131 local URL=$1 132 133 if [ -n "$URL" ]; then 134 local basename=$(basename $URL) 135 local candidate=$(find "$TARFILE_LOCATION" -type f -name "*-$basename") 136 if [ -n "$candidate" ]; then 137 echo "$basename is already present ($candidate)" --- 12 unchanged lines hidden (view full) --- 150 fi 151 fi 152 fi 153} 154 155# 156# Download a file from a URL and check its md5 sum to the one that is part of its name. 157# | 130{ 131 local URL=$1 132 133 if [ -n "$URL" ]; then 134 local basename=$(basename $URL) 135 local candidate=$(find "$TARFILE_LOCATION" -type f -name "*-$basename") 136 if [ -n "$candidate" ]; then 137 echo "$basename is already present ($candidate)" --- 12 unchanged lines hidden (view full) --- 150 fi 151 fi 152 fi 153} 154 155# 156# Download a file from a URL and check its md5 sum to the one that is part of its name. 157# |
158function download_and_check () | 158download_and_check () |
159{ 160 local URL=$1 161 162 if [ -n "$URL" ]; then 163 local basename=$(basename $URL) 164 if [ -f "$TARFILE_LOCATION/$basename" ]; then 165 echo "$basename is already present" 166 else --- 80 unchanged lines hidden --- | 159{ 160 local URL=$1 161 162 if [ -n "$URL" ]; then 163 local basename=$(basename $URL) 164 if [ -f "$TARFILE_LOCATION/$basename" ]; then 165 echo "$basename is already present" 166 else --- 80 unchanged lines hidden --- |