Sha256: 64684540376a22cb4d150d3ce760d8e8ad0810b56f6bd6496a34c5f287677ac1

Contents?: true

Size: 1.72 KB

Versions: 10

Compression:

Stored size: 1.72 KB

Contents

# fetch_package.sh
############
# This section fetchs a package from $download_url and verifies its metadata.
#
# Inputs:
# $download_url:
# $tmp_dir:
# Optional Inputs:
# $cmdline_filename: Name of the package downloaded on local disk.
# $cmdline_dl_dir: Name of the directory downloaded package will be saved to on local disk.
#
# Outputs:
# $download_filename: Name of the downloaded file on local disk.
# $filetype: Type of the file downloaded.
############

filename=`echo $download_url | sed -e 's/^.*\///'`
filetype=`echo $filename | sed -e 's/^.*\.//'`

# use either $tmp_dir, the provided directory (-d) or the provided filename (-f)
if test "x$cmdline_filename" != "x"; then
  download_filename="$cmdline_filename"
elif test "x$cmdline_dl_dir" != "x"; then
  download_filename="$cmdline_dl_dir/$filename"
else
  download_filename="$tmp_dir/$filename"
fi

# ensure the parent directory where to download the installer always exists
download_dir=`dirname $download_filename`
(umask 077 && mkdir -p $download_dir) || exit 1

# check if we have that file locally available and if so verify the checksum
cached_file_available="false"
if test -f $download_filename; then
  echo "$download_filename already exists, verifiying checksum..."
  if do_checksum "$download_filename" "$sha256" "$md5"; then
    echo "checksum compare succeeded, using existing file!"
    cached_file_available="true"
  else
    echo "checksum mismatch, downloading latest version of the file"
  fi
fi

# download if no local version of the file available
if test "x$cached_file_available" != "xtrue"; then
  do_download "$download_url"  "$download_filename"
  do_checksum "$download_filename" "$sha256" "$md5" || checksum_mismatch
fi

############
# end of fetch_package.sh
############

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mixlib-install-0.8.0.alpha.7 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
wjordan-mixlib-install-0.8.0.fork.7 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
wjordan-mixlib-install-0.8.0.alpha.6 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.6 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.5 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.4 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.3 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.2 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.1 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh
mixlib-install-0.8.0.alpha.0 lib/mixlib/install/generator/bourne/scripts/fetch_package.sh