Created
August 15, 2014 08:09
-
-
Save anonymous/ff3dbeafc9f5cbd5182d to your computer and use it in GitHub Desktop.
aurget_split_package_support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/bin/aurget 2014-06-13 11:50:43.000000000 +0200 | |
+++ aurget 2014-08-15 09:41:44.965831507 +0200 | |
@@ -133,6 +133,7 @@ | |
} | |
/Name":/ { printf "%s", unstring($0) } | |
+ /PackageBase":/ { printf "|%s", unstring($0) } | |
/Version":/ { printf "|%s", unstring($0) } | |
/Description":/ { printf "|%s", unstring($0) } | |
/URL":/ { printf "|%s", unstring($0) } | |
@@ -383,13 +384,15 @@ | |
print_info() { | |
local name version description url votes outofdate ood | |
- while IFS='|' read -r name version description url votes outofdate; do | |
+ while IFS='|' read -r name pkgbase version description url votes outofdate; do | |
ood='No' | |
(( outofdate )) && ood="${colorR}Yes$nocolor" | |
printf "${colorW}Repository : ${colorM}aur$nocolor\n" | |
printf "${colorW}Name : $name$nocolor\n" | |
+ [[ "$name" != "$pkgbase" ]] && \ | |
+ printf "${colorW}Base : $colorB$pkgbase$nocolor\n" | |
printf "${colorW}Version : $colorG$version$nocolor\n" | |
printf "${colorW}URL : $colorC$url$nocolor\n" | |
printf "${colorW}Out of date : $nocolor$ood\n" | |
@@ -408,7 +411,7 @@ | |
} | |
available_upgrades() { | |
- local versions name version vers versN check | |
+ local versions name pkgbase version vers versN check | |
declare -A versions | |
@@ -418,7 +421,7 @@ | |
debug "found $colorG${#versions[@]}$nocolor foreign packages to check" | |
- while IFS='|' read -r name versN _; do | |
+ while IFS='|' read -r name pkgbase versN _; do | |
if is_devel "$name"; then | |
$devels && output_upgrade "$name" 'development package' | |
continue | |
@@ -497,9 +500,10 @@ | |
# Setup targets {{{ | |
setup_targets() { | |
- local name version versions pkgbuild | |
+ local name pkgbase version versions pkgbases pkgbuild | |
declare -A versions | |
+ declare -A pkgbases | |
set -- "${dependencies[@]}" "${arguments[@]}" | |
@@ -512,12 +516,14 @@ | |
info 'Searching AUR...' | |
- while IFS='|' read -r name version _; do | |
+ while IFS='|' read -r name pkgbase version _; do | |
debug "found $colorG$name$nocolor in the AUR at version $colorG$version$nocolor" | |
+ pkgbases[$name]=$pkgbase | |
versions[$name]=$version | |
done < <(rpc_info "$@") | |
for name; do | |
+ pkgbase="${pkgbases[$name]}" | |
version="${versions[$name]}" | |
if [[ -z "$version" ]]; then | |
@@ -541,13 +547,15 @@ | |
fi | |
fi | |
- targets+=( "$name" ) | |
+ [[ -n "${targets[$pkgbase]}" ]] && \ | |
+ targets[$pkgbase]+="," | |
+ targets[$pkgbase]+="$name" | |
target_versions[$name]=$version | |
done | |
(( "${#targets[@]}" )) || nothing_to_do | |
- prompt_to_install "${targets[@]}" | |
+ prompt_to_install "${!target_versions[@]}" | |
} | |
# }}} | |
@@ -555,7 +563,7 @@ | |
process_targets() { | |
local name ret=0 | |
- set -- "${targets[@]}" | |
+ set -- "${!targets[@]}" | |
installing && makepkg_options+=' --install' | |
@@ -613,9 +621,9 @@ | |
if prompt_to_edit "$name" './PKGBUILD' 'building'; then | |
if (( ${target_deps[$name]} )); then | |
- buildpkg --asdeps || die "dependency package $name failed to build, aborting" | |
+ buildpkg --pkg "${targets[$name]}" --asdeps || die "dependency package $name failed to build, aborting" | |
else | |
- buildpkg || { ret=1; warn "package $name failed to build, skipping"; } | |
+ buildpkg --pkg "${targets[$name]}" || { ret=1; warn "package $name failed to build, skipping"; } | |
fi | |
fi | |
@@ -654,7 +662,7 @@ | |
declare -a arguments | |
declare -a dependencies | |
-declare -a targets | |
+declare -A targets # pkgbase->name(s) | |
declare -A target_versions # name->version | |
declare -A target_deps # name->is-dep? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment