This commit is contained in:
milisbir 2017-07-22 02:54:42 +03:00
parent 3922bb586e
commit cf67977991
2 changed files with 1557 additions and 8 deletions

View file

@ -26,7 +26,9 @@ abort_on_build() {
exit $E_BUILD exit $E_BUILD
} }
get_filename() { get_filename() {
if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then if [[ "$1" =~ "--"(.+) ]] ;then
echo "$DERLEME_KAYNAKDIZIN/${BASH_REMATCH[1]}"
elif [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
echo "$DERLEME_KAYNAKDIZIN/${BASH_REMATCH[2]}" echo "$DERLEME_KAYNAKDIZIN/${BASH_REMATCH[2]}"
else else
echo $1 echo $1
@ -143,10 +145,16 @@ downloads_file_with_curl() {
fi fi
} }
download_file() { download_file() {
info "İndiriliyor '$1'."
if [[ "$1" =~ (.+)"--" ]] ;then
adres="${BASH_REMATCH[0]}"
adres=`echo $adres | sed s'/..$//' `
else
adres="$1"
fi
info "İndiriliyor $adres"
LOCAL_FILENAME=`get_filename $1` LOCAL_FILENAME=`get_filename $1`
info "kayıt:$LOCAL_FILENAME"
if [ ! "`type -p wget`" ]; then if [ ! "`type -p wget`" ]; then
warning "Command 'wget' not found." warning "Command 'wget' not found."
info "You should install 'wget' as soon as possible, trying with curl ..." info "You should install 'wget' as soon as possible, trying with curl ..."
@ -154,7 +162,7 @@ download_file() {
else else
LOCAL_FILENAME_PARTIAL="$LOCAL_FILENAME.partial" LOCAL_FILENAME_PARTIAL="$LOCAL_FILENAME.partial"
DOWNLOAD_OPTS="--passive-ftp --no-directories --tries=3 --waitretry=3 \ DOWNLOAD_OPTS="--passive-ftp --no-directories --tries=3 --waitretry=3 \
--directory-prefix=$DERLEME_KAYNAKDIZIN \ -O $LOCAL_FILENAME \
--output-document=$LOCAL_FILENAME_PARTIAL --no-check-certificate" --output-document=$LOCAL_FILENAME_PARTIAL --no-check-certificate"
if [ -f "$LOCAL_FILENAME_PARTIAL" ]; then if [ -f "$LOCAL_FILENAME_PARTIAL" ]; then
@ -164,7 +172,7 @@ download_file() {
error=1 error=1
BASENAME=`get_basename $1` BASENAME=`get_basename $adres`
for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do
REPO="`echo $REPO | sed 's|/$||'`" REPO="`echo $REPO | sed 's|/$||'`"
wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $REPO/$BASENAME wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $REPO/$BASENAME
@ -176,7 +184,7 @@ download_file() {
if [ $error != 0 ]; then if [ $error != 0 ]; then
while true; do while true; do
wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $1 wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $adres
error=$? error=$?
if [ $error != 0 ] && [ "$RESUME_CMD" ]; then if [ $error != 0 ] && [ "$RESUME_CMD" ]; then
info "Partial download failed, restarting" info "Partial download failed, restarting"
@ -189,7 +197,7 @@ download_file() {
fi fi
if [ $error != 0 ]; then if [ $error != 0 ]; then
error "İndiriliyor '$1' başarısız." error "İndiriliyor '$adres' başarısız."
exit $E_DOWNLOAD exit $E_DOWNLOAD
fi fi

1541
bin/mpsd220717 Executable file

File diff suppressed because it is too large Load diff