Skip to content

Commit

Permalink
Address pullrequest issues
Browse files Browse the repository at this point in the history
Pull request conversation: pbrisbin#62

main issue: pbrisbin#41
  • Loading branch information
LilyCathelineau committed Nov 16, 2018
1 parent b02a397 commit 846f7df
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions aurget
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,13 @@ resolving() { $resolve_dependencies; }
eager_sudo() { $eager_sudo; }

create_package_directory() {
if [ -d "$pkgbuild_directory" ]
then
else
mkdir "$pkgbuild_directory" || die 'unable to create package directory'
if [[ ! -d $cache_directory ]]; then
mkdir "$cache_directory" || die 'unable to create package directory'
fi
}

clean_package_directory() {
rm -rf "${pkgbuild_directory:?}"/*
rm -rf "${cache_directory:?}"/*
}

enter_build_directory() {
Expand Down Expand Up @@ -342,7 +340,8 @@ set_defaults() {
silent=false
sort_mode='name'
sync_mode='install'
pkgbuild_directory='~/.cache/aurget'
cache_directory="${XDG_CACHE_HOME:-$HOME/.cache}/aurget"
temp_directory="/tmp/aurget"
user_config="${XDG_CONFIG_HOME:-$HOME/.config}/aurgetrc"

EDITOR="${EDITOR:-$VISUAL}"
Expand Down Expand Up @@ -513,8 +512,10 @@ resolve() {
}

source_pkgbuild() {
local name="$1" pkgbuild="$pkgbuild_directory/${1}_PKGBUILD"

local name="$1" pkgbuild="$temp_directory/${1}_PKGBUILD"
rpc_info "$@"
mv $tmp_directory/${1}_PKGBUILD $cache/$name/$version/PKGBUILD
pkgbuild="$cache/$name/$version/PKGBUILD"
if [[ ! -f "$pkgbuild" ]]; then
if pkgbuild "$name" > "$pkgbuild"; then
debug "PKGBUILD found for $colorG$name$nocolor"
Expand Down Expand Up @@ -565,7 +566,7 @@ setup_targets() {
version="${versions[$name]}"

if [[ -z "$version" ]]; then
pkgbuild="$pkgbuild_directory/${name}_PKGBUILD"
pkgbuild="$cache_directory/${name}_PKGBUILD"

if [[ -f "$pkgbuild" ]]; then
debug "target $colorG$name$nocolor may have moved to repos"
Expand Down Expand Up @@ -730,8 +731,8 @@ declare -A target_deps # pkgbase->is-dep?
initialize "$@"
if clean; then
clean_package_directory
fi
if searching; then
elif
searching; then
perform_search
else
eager_sudo && sudo_upfront
Expand Down

0 comments on commit 846f7df

Please sign in to comment.