Don't download existing sources

This commit is contained in:
Jack L. Frost 2015-02-06 09:28:40 +03:00
parent d1becc7836
commit c8b1f67bdd

18
zpac
View File

@ -72,6 +72,13 @@ aur.get() {
jshon -e results -e PackageBase -u -p -e URLPath -u <<< "$pkg_aur_info"
)
(( flag_force )) || {
[[ -d "${cfg_workdir}/${pkg_base}" ]] && {
echo "Found ${pkg_base} in ${cfg_workdir}, skipping. Use -f to override."
return 17
}
}
cd "$cfg_workdir"
echo "Downloading ${cfg_aur_url}${tarball_path}"
@ -100,8 +107,13 @@ aur.get() {
aur_deps=( $( jshon -e results -a -e Name -u <<< "$aur_deps_api_data" ) )
for i in "${aur_deps[@]}"; do
aur.get < <(aur.info "$i") || {
return "$?"
aur.get < <(aur.info "$i")
_result="$?"
(( _result )) && {
(( _result == 17 )) || {
return "$_result"
}
}
done
fi
@ -182,6 +194,8 @@ main() {
fi
;;
(-f) flag_force=1;;
(--) shift; break;;
(-*)
err "Unknown key: $1"