mpsd
This commit is contained in:
parent
3922bb586e
commit
cf67977991
2 changed files with 1557 additions and 8 deletions
24
bin/mpsd
24
bin/mpsd
|
@ -26,7 +26,9 @@ abort_on_build() {
|
|||
exit $E_BUILD
|
||||
}
|
||||
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]}"
|
||||
else
|
||||
echo $1
|
||||
|
@ -143,10 +145,16 @@ downloads_file_with_curl() {
|
|||
fi
|
||||
}
|
||||
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`
|
||||
|
||||
info "kayıt:$LOCAL_FILENAME"
|
||||
if [ ! "`type -p wget`" ]; then
|
||||
warning "Command 'wget' not found."
|
||||
info "You should install 'wget' as soon as possible, trying with curl ..."
|
||||
|
@ -154,7 +162,7 @@ download_file() {
|
|||
else
|
||||
LOCAL_FILENAME_PARTIAL="$LOCAL_FILENAME.partial"
|
||||
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"
|
||||
|
||||
if [ -f "$LOCAL_FILENAME_PARTIAL" ]; then
|
||||
|
@ -164,7 +172,7 @@ download_file() {
|
|||
|
||||
error=1
|
||||
|
||||
BASENAME=`get_basename $1`
|
||||
BASENAME=`get_basename $adres`
|
||||
for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do
|
||||
REPO="`echo $REPO | sed 's|/$||'`"
|
||||
wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $REPO/$BASENAME
|
||||
|
@ -176,7 +184,7 @@ download_file() {
|
|||
|
||||
if [ $error != 0 ]; then
|
||||
while true; do
|
||||
wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $1
|
||||
wget $RESUME_CMD $DOWNLOAD_OPTS $PKGMK_WGET_OPTS $adres
|
||||
error=$?
|
||||
if [ $error != 0 ] && [ "$RESUME_CMD" ]; then
|
||||
info "Partial download failed, restarting"
|
||||
|
@ -189,7 +197,7 @@ download_file() {
|
|||
fi
|
||||
|
||||
if [ $error != 0 ]; then
|
||||
error "İndiriliyor '$1' başarısız."
|
||||
error "İndiriliyor '$adres' başarısız."
|
||||
exit $E_DOWNLOAD
|
||||
fi
|
||||
|
||||
|
|
1541
bin/mpsd220717
Executable file
1541
bin/mpsd220717
Executable file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue