Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output packages that are not in AUR #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions packer
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ isignored() {

# Tests whether $1 exists on the aur
existsinaur() {
rpcinfo "$1"
[[ -f "$tmpdir/$1.info" ]] || rpcinfo "$1"
[[ "$(jshon -Qe resultcount -u < "$tmpdir/$1.info")" != "0" ]]
}

Expand Down Expand Up @@ -515,6 +515,7 @@ if [[ $option = update ]]; then
IFS=$'\n' read -rd '' -a packages < <(pacman -Qm)
newpackages=()
checkignores=()
notinaurpackages=()
total="${#packages[@]}"
grep -q '^ *ILoveCandy' "$pacmanconf" && bartype='candy' || bartype='normal'

Expand All @@ -533,7 +534,8 @@ if [[ $option = update ]]; then
for ((i=0; i<$total; i++)); do
pkg="${packages[i]%% *}"
ver="${packages[i]##* }"
if [[ ! -s "$tmpdir/$pkg.PKGBUILD" ]]; then
if ! existsinaur "$pkg"; then
notinaurpackages+=("$pkg")
continue
fi
if isignored "$pkg"; then
Expand All @@ -558,7 +560,9 @@ if [[ $option = update ]]; then
for ((i=0; i<$total; i++)); do
pkg="${packages[i]%% *}"
ver="${packages[i]##* }"
if isignored "$pkg"; then
if ! existsinaur "$pkg"; then
notinaurpackages+=("$pkg")
elif isignored "$pkg"; then
checkignores+=("${packages[i]}")
elif aurversionisnewer "$pkg" "$ver"; then
newpackages+=("$pkg")
Expand All @@ -569,6 +573,11 @@ if [[ $option = update ]]; then

echo -e "${COLOR5}:: ${COLOR1}Starting full aur upgrade...${ENDCOLOR}"

# Output packages that are not in AUR
for package in "${notinaurpackages[@]}"; do
echo -e "${COLOR6}information:${ENDCOLOR} $package: package does not exist in AUR"
done

# Check and output ignored package update info
for package in "${checkignores[@]}"; do
if aurversionisnewer "${package%% *}" "${package##* }"; then
Expand Down