#!/bin/bash

cd /mnt/gentoo/usr || exit 1

echo "wget ${PORTAGELINK}"
if ! wget "${PORTAGELINK}";
then
  wget "${PORTAGELINK}"
fi

portage_file=$(basename ${PORTAGELINK})
tar xjf "${portage_file}"

# suffixes=(portage-latest.tar.bz2 portage-latest.tar.bz2.gpgsig portage-latest.tar.bz2.md5sum)
# for item in ${dwn_links[*]}
# do
#   echo "wget ${PORTAGELINK}/${item}"
#   if ! wget "${PORTAGELINK}/${item}";
#   then
#     wget "${PORTAGELINK}/${item}"
#   fi
# done
# 
# echo 'INFO: portage uncompressing...'
# md5sum -c portage-latest.tar.bz2.md5sum && tar xjf portage-latest.tar.bz2
