Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Update pacaur 5.0 branch #661

Merged
merged 17 commits into from
Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Read me first: [Bug reports](https://github.com/rmarquis/pacaur/wiki/Bug-reports)

AND FOR GODS SAKE, do not ask support questions on the bug tracker. I'm not here to fix your freaking INCOMPETENCE.
Or.give.me.MONEY. For paying support, see Paypal link in man page.

###### Version

Expand Down
10 changes: 9 additions & 1 deletion README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ I would also suggest to donate to a charitable organization of your choice
should you believe that your money could make a bigger difference there.
Thank you!

Absolutely B<no support> is provided, unless you are ready to pay for it.

All credits go to all direct or indirect contributors. Many thanks to all of
you!

Expand All @@ -424,7 +426,9 @@ B<[da] - Dansk> - Filip "filipkemuel" Kemuel

B<[de] - Deutsch> - Marco "BigBoot" Kirchner, "HerrNieschnell", "pszalanski", Stefan "rumpelsepp" Tatschner, Tilman "Tblue" Blumenbach

B<[es] - Español> - Germán "gosella" Osella Massa, Ismael "ChuckDaniels87" González
B<[es] - Español> - Germán "gosella" Osella Massa, Ismael "ChuckDaniels87" González, Pablo "jristz" Lezaeta Reyes

B<[fi] - Suomi> - "durazell"

B<[fr] - Français> - "spider-mario", "Neitsab", Antoine "Nevax07" Gravelot

Expand All @@ -444,7 +448,11 @@ B<[ru] - Русский> - "kyak"

B<[sk] - Slovenčina> - Pavol "pakapusta" Kapusta, Juraj "DoctorJellyface" Fiala

B<[sl] - Slovenščina> - Žan "tofiffe" Skamljič

B<[sr] - Српски / srpski> - Slobodan "Faenriis" Terzić

B<[tr] - Türkçe> - Volkan "wakeup" Gezer

B<[zh_CN] - 简化中文> - "kizayoi"

6 changes: 3 additions & 3 deletions libpacaur/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IgnoreChecks() {

# check targets
SetJson ${aurpkgsnover[@]}
checkaurpkgs=($(GetJson "var" "$json" "Name" | LC_COLLATE=C sort))
checkaurpkgs=($(GetJson "var" "$json" "Name"))
errdeps+=($(grep -xvf <(printf '%s\n' "${aurpkgsnover[@]}") <(printf '%s\n' "${checkaurpkgs[@]}")))
errdeps+=($(grep -xvf <(printf '%s\n' "${checkaurpkgs[@]}") <(printf '%s\n' "${aurpkgsnover[@]}")))
unset aurpkgsnover
Expand Down Expand Up @@ -329,7 +329,7 @@ CheckUpdates() {
[[ -z "${pkgs[@]}" ]] && foreignpkgs=($($pacmanbin -Qmq ${pacopts[@]})) || foreignpkgs=(${pkgs[@]})
if [[ -n "${foreignpkgs[@]}" ]]; then
SetJson ${foreignpkgs[@]}
aurpkgsAname=($(GetJson "var" "$json" "Name" | LC_COLLATE=C sort))
aurpkgsAname=($(GetJson "var" "$json" "Name"))
aurpkgsAver=($(GetJson "var" "$json" "Version"))
aurpkgsQver=($(expac -Q '%v' ${aurpkgsAname[@]}))
for i in "${!aurpkgsAname[@]}"; do
Expand Down Expand Up @@ -368,7 +368,7 @@ CheckUpdates() {

if [[ -n "${aurpkgsQood[@]}" && ! $quiet ]]; then
SetJson ${aurpkgsQood[@]}
aurpkgsAname=($(GetJson "var" "$json" "Name" | LC_COLLATE=C sort))
aurpkgsAname=($(GetJson "var" "$json" "Name"))
aurpkgsAname=($(expac -Q '%n' "${aurpkgsAname[@]}"))
aurpkgsAver=($(GetJson "var" "$json" "Version"))
aurpkgsQver=($(expac -Q '%v' "${aurpkgsAname[@]}"))
Expand Down
9 changes: 7 additions & 2 deletions libpacaur/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ DepsSolver() {
SortDepsAur ${aurpkgs[@]}
deps=($(tsort <<< ${tsortdeps[@]}))

# error check
if (($? > 0)); then
Note "e" $"dependency cycle detected"
fi

# get AUR packages info
depsAname=($(GetJson "var" "$json" "Name" | LC_COLLATE=C sort))
depsAname=($(GetJson "var" "$json" "Name"))
depsAver=($(GetJson "var" "$json" "Version"))
depsAood=($(GetJson "var" "$json" "OutOfDate"))
depsAmain=($(GetJson "var" "$json" "Maintainer"))
Expand Down Expand Up @@ -232,7 +237,7 @@ FindDepsAur() {
fi

# dependency cycle check
[[ -n "${prevdepspkgsaur[@]}" ]] && [[ "${prevdepspkgsaur[*]}" == "${depspkgsaur[*]}" ]] && Note "e" $"dependency cycle detected"
[[ -n "${prevdepspkgsaur[@]}" ]] && [[ "${prevdepspkgsaur[*]}" == "${depspkgsaur[*]}" ]] && Note "e" $"dependency cycle detected (${depspkgsaur[*]})"

if [[ -n "${depspkgsaur[@]}" ]]; then
# store for AUR version check
Expand Down
4 changes: 2 additions & 2 deletions libpacaur/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ UpgradeAur() {
else
foreignpkgs=($($pacmanbin -Qmq))
SetJson ${foreignpkgs[@]}
allaurpkgs=($(GetJson "var" "$json" "Name" | LC_COLLATE=C sort))
allaurpkgs=($(GetJson "var" "$json" "Name"))
allaurpkgsAver=($(GetJson "var" "$json" "Version"))
allaurpkgsQver=($(expac -Q '%v' ${allaurpkgs[@]}))
for i in "${!allaurpkgs[@]}"; do
Expand Down Expand Up @@ -63,7 +63,7 @@ Prompt() {
summ=0
for i in "${!repodepspkgs[@]}"; do
GetBuiltPkg "${repodepspkgs[$i]}-${repodepsSver[$i]}" '/var/cache/pacman/pkg'
[[ $builtpkg ]] && binaryksize=(${binaryksize[@]/${binaryksize[$i]}/0})
[[ $builtpkg ]] && binaryksize[$i]=0
sumk=$((sumk + ${binaryksize[$i]}))
summ=$((summ + ${binarymsize[$i]}))
done
Expand Down
28 changes: 16 additions & 12 deletions libpacaur/pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ EditPkgs() {
}

MakePkgs() {
local oldorphanpkgs neworphanpkgs orphanpkgs oldoptionalpkgs newoptionalpkgs optionalpkgs
local oldorphanpkgs neworphanpkgs orphanpkgs oldoptionalpkgs newoptionalpkgs optionalpkgs errinstall
local pkgsdepslist vcsclients vcschecked aurdevelpkgsAver aurdevelpkgsQver basepkgsupdate checkpkgsdepslist isaurdeps builtpkgs builtdepspkgs i j
# global deps basepkgs sudoloop pkgsbase pkgsdeps aurpkgs aurdepspkgs depsAver builtpkg errmakepkg repoprovidersconflictingpkgs aurprovidersconflictingpkgs json

Expand Down Expand Up @@ -204,13 +204,13 @@ MakePkgs() {
Note "f" $"failed to verify ${colorW}$i${reset} integrity"
done
# remove sudo lock
[[ -e "/run/user/$UID/pacaur.sudov.lck" ]] && rm "/run/user/$UID/pacaur.sudov.lck"
[[ -e "$tmpdir/pacaur.sudov.lck" ]] && rm "$tmpdir/pacaur.sudov.lck"
exit 1
fi

# set build lock
[[ -e "/run/lock/pacaur.build.lck" ]] && Note "e" $"pacaur.build.lck exists in /run/lock" && exit 1
sudo touch "/run/lock/pacaur.build.lck"
[[ -e "$tmpdir/pacaur.build.lck" ]] && Note "e" $"pacaur.build.lck exists in $tmpdir" && exit 1
touch "$tmpdir/pacaur.build.lck"

# install provider packages and repo conflicting packages that makepkg --noconfirm cannot handle
if [[ -n "${repoprovidersconflictingpkgs[@]}" ]]; then
Expand Down Expand Up @@ -286,9 +286,9 @@ MakePkgs() {
fi

if [[ $silent = true ]]; then
makepkg -sfc ${makeopts[@]} --noconfirm &>/dev/null
makepkg -sefc ${makeopts[@]} --noconfirm &>/dev/null
else
makepkg -sfc ${makeopts[@]} --noconfirm
makepkg -sefc ${makeopts[@]} --noconfirm
fi

# error check
Expand All @@ -310,8 +310,12 @@ MakePkgs() {
if [[ $installpkg || -z "${builtpkgs[@]}" ]]; then
Note "i" $"Installing ${colorW}${pkgsdeps[$i]}${reset} package(s)..."
# metadata mismatch warning
[[ -z "${builtdepspkgs[@]}" && -z "${builtpkgs[@]}" ]] && Note "f" $"${colorW}${pkgsdeps[$i]}${reset} package(s) failed to install. Check .SRCINFO for mismatching data with PKGBUILD."
[[ -n "${builtdepspkgs[@]}" || -n "${builtpkgs[@]}" ]] && sudo $pacmanbin -Ud ${builtdepspkgs[@]} ${builtpkgs[@]} --ask 36 ${pacopts[@]} --noconfirm
if [[ -z "${builtdepspkgs[@]}" && -z "${builtpkgs[@]}" ]]; then
Note "f" $"${colorW}${pkgsdeps[$i]}${reset} package(s) failed to install. Check .SRCINFO for mismatching data with PKGBUILD."
errinstall+=(${pkgsdeps[$i]})
else
sudo $pacmanbin -Ud ${builtdepspkgs[@]} ${builtpkgs[@]} --ask 36 ${pacopts[@]} --noconfirm
fi
fi

# set dep status
Expand All @@ -337,8 +341,8 @@ MakePkgs() {
fi

# remove locks
sudo rm "/run/lock/pacaur.build.lck"
[[ -e "/run/user/$UID/pacaur.sudov.lck" ]] && rm "/run/user/$UID/pacaur.sudov.lck"
rm "$tmpdir/pacaur.build.lck"
[[ -e "$tmpdir/pacaur.sudov.lck" ]] && rm "$tmpdir/pacaur.sudov.lck"

# new orphan and optional packages check
orphanpkgs=($($pacmanbin -Qdtq))
Expand All @@ -353,8 +357,8 @@ MakePkgs() {
Note "w" $"${colorW}$i${reset} is now an ${colorY}optional${reset} package"
done

# makepkg failure check
if [[ -n "${errmakepkg[@]}" ]]; then
# makepkg and install failure check
if [[ -n "${errmakepkg[@]}" || -n "${errinstall[@]}" ]]; then
for i in "${errmakepkg[@]}"; do
Note "f" $"failed to build ${colorW}$i${reset} package(s)"
done
Expand Down
8 changes: 4 additions & 4 deletions libpacaur/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ NothingToDo() {
}

SudoV() {
touch "/run/user/$UID/pacaur.sudov.lck"
while [[ -e "/run/user/$UID/pacaur.sudov.lck" ]]; do
touch "$tmpdir/pacaur.sudov.lck"
while [[ -e "$tmpdir/pacaur.sudov.lck" ]]; do
sudo $pacmanbin -V > /dev/null
sleep 2
done
Expand All @@ -87,7 +87,7 @@ SudoV() {
trap Cancel INT
Cancel() {
echo
[[ -e "/run/lock/pacaur.build.lck" ]] && sudo rm "/run/lock/pacaur.build.lck"
[[ -e "/run/user/$UID/pacaur.sudov.lck" ]] && rm "/run/user/$UID/pacaur.sudov.lck"
[[ -e "$tmpdir/pacaur.build.lck" ]] && rm "$tmpdir/pacaur.build.lck"
[[ -e "$tmpdir/pacaur.sudov.lck" ]] && rm "$tmpdir/pacaur.sudov.lck"
exit
}
15 changes: 10 additions & 5 deletions pacaur
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# pacaur: an AUR helper that minimizes user interaction
#

version="4.6.10"
version="5.0.0"

#
# Config
Expand All @@ -29,6 +29,7 @@ configdir="${XDG_CONFIG_DIRS:-/etc/xdg}/pacaur"
userconfigdir="${XDG_CONFIG_HOME:-${HOME}/.config}/pacaur"
userpacmandir="${XDG_CONFIG_HOME:-${HOME}/.config}/pacman"
usercachedir="${XDG_CACHE_HOME:-${HOME}/.cache}/pacaur"
tmpdir="${XDG_RUNTIME_DIR:-/tmp}"

# source makepkg variables
if [[ -r "$MAKEPKG_CONF" ]]; then
Expand Down Expand Up @@ -252,10 +253,10 @@ pacmanarg=(${pacmanarg[@]/-a/})
[[ $pacS ]] && pacmanarg=(${pacmanarg[@]/-e/})
[[ $pacS ]] && [[ $search && $info ]] && coweropts=(${coweropts[@]/-i/})
[[ $pacS ]] && [[ $cleancache ]] && unset search info upgrade
[[ ! $(command -v "$editor") ]] && Note "e" $"${colorW}editor${reset} variable unset"
[[ ! $(command -v "${editor%% *}") ]] && Note "e" $"${colorW}editor${reset} variable unset"
[[ ! -w "$clonedir" ]] && Note "e" $"${colorW}$clonedir${reset} does not have write permission."
[[ -z "${pkgs[@]}" ]] && [[ $operation = download || $operation = sync || $operation = editpkg ]] && [[ ! $refresh && ! $upgrade && ! $cleancache ]] && Note "e" $"no targets specified (use -h for help)"
[[ -z "${pkgs[@]}" && -n "$(grep -e "-[RU]" <<< ${pacmanarg[@]})" ]] && Note "e" $"no targets specified (use -h for help)"
[[ -z "${pkgs[@]}" && -n "$(grep -e "-[RU]" <<< ${pacmanarg[@]})" && -z "$(grep -e "-[h]" <<< ${pacmanarg[@]})" ]] && Note "e" $"no targets specified (use -h for help)"
[[ $repo && $aur ]] && Note "e" $"target not found"

# operations
Expand All @@ -267,7 +268,11 @@ case $operation in
DepsSolver
DownloadPkgs ${deps[@]}
else
[[ -n "${aurpkgs[@]}" ]] && DownloadPkgs ${aurpkgs[@]} || exit 1
if [[ -n "${aurpkgs[@]}" ]]; then
DownloadPkgs ${aurpkgs[@]}
else
exit 1
fi
fi
EditPkgs ${pkgsbase[@]}
exit;;
Expand Down Expand Up @@ -322,7 +327,7 @@ case $operation in
fi
fi
# display info without buffer delay
tmpinfo=$(mktemp "/run/user/$UID/pacaur.infoaur.XXXX") && InfoAur ${aurpkgs[@]} > $tmpinfo && cat $tmpinfo && rm $tmpinfo
tmpinfo=$(mktemp "$tmpdir/pacaur.infoaur.XXXX") && InfoAur ${aurpkgs[@]} > $tmpinfo && cat $tmpinfo && rm $tmpinfo
fi
# clean (-Sc) handling
elif [[ $cleancache ]]; then
Expand Down
Loading