diff --git a/buildpkg b/buildpkg index 954792e..d99ac2c 100755 --- a/buildpkg +++ b/buildpkg @@ -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 diff --git a/functions b/functions index 3cb2343..f7df460 100644 --- a/functions +++ b/functions @@ -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 } diff --git a/installpkg b/installpkg index 2ae6c36..4f74071 100755 --- a/installpkg +++ b/installpkg @@ -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