This commit is contained in:
emmett1
2017-08-23 20:54:46 +08:00
parent f4b2053b4c
commit 58fec06d66
3 changed files with 12 additions and 6 deletions

View File

@@ -75,12 +75,16 @@ getsource() {
done
}
downloadsource(){
checkforwget() {
if [ ! -e /usr/bin/wget ]; then
msgerr "Wget not installed."
exitscript1
fi
}
downloadsource(){
tarballname=$(echo $1 | rev | cut -d / -f 1 | rev)
WGETCMD="wget --passive-ftp --no-directories --tries=3 --waitretry=3 --output-document=$SOURCE_DIR/$tarballname.partial"
@@ -97,9 +101,11 @@ downloadsource(){
else
if [ -f $SOURCE_DIR/$tarballname.partial ]; then
msg "Resuming ${color_green}$1${color_reset}."
checkforwget
$WGETRESUME $1 && mv $SOURCE_DIR/$tarballname.partial $SOURCE_DIR/$tarballname || exitscript1
else
msg "Downloading ${color_green}$1${color_reset}."
checkforwget
$WGETCMD $1 && mv $SOURCE_DIR/$tarballname.partial $SOURCE_DIR/$tarballname || exitscript1
fi
fi

View File

@@ -137,8 +137,6 @@ updatesystemdb() {
getpkginfo() {
. $BUILD_SCRIPT
description=$(cat $BUILD_SCRIPT | grep ^'# description' | tr -d ':' | cut -d ' ' -f 3-)
homepage=$(cat $BUILD_SCRIPT | grep ^'# homepage' | tr -d ':' | cut -d ' ' -f 3-)
maintainer=$(cat $BUILD_SCRIPT | grep ^'# maintainer' | tr -d ':' | cut -d ' ' -f 3-)
@@ -147,6 +145,8 @@ getpkginfo() {
depends=$(cat $BUILD_SCRIPT | grep ^'# depends' | tr -d ':' | cut -d ' ' -f 3-)
makedepends=$(cat $BUILD_SCRIPT | grep ^'# makedepends' | tr -d ':' | cut -d ' ' -f 3-)
noextract=$(cat $BUILD_SCRIPT | grep ^'# noextract' | tr -d ':' | cut -d ' ' -f 3-)
. $BUILD_SCRIPT
}

View File

@@ -265,13 +265,13 @@ check_directory() {
for dir in $INDEX_DIR $BACKUP_DIR $REJECTED_DIR; do
if [ ! -d $dir ]; then
msg "Directory ${color_yellow}$dir${color_reset} not exist."
msgwarn "Directory ${color_yellow}$dir${color_reset} not exist."
DIR_ERROR=yes
elif [ ! -w $dir ]; then
msg "Directory ${color_yellow}$dir${color_reset} not writable."
msgwarn "Directory ${color_yellow}$dir${color_reset} not writable."
DIR_ERROR=yes
elif [ ! -x $dir ] || [ ! -r $1 ]; then
msg "Directory ${color_yellow}$dir${color_reset} not readable."
msgwarn "Directory ${color_yellow}$dir${color_reset} not readable."
DIR_ERROR=yes
fi
done