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

Sync databases before determining whether to check AUR #732

Open
favonia opened this issue Jul 22, 2017 · 1 comment
Open

Sync databases before determining whether to check AUR #732

favonia opened this issue Jul 22, 2017 · 1 comment

Comments

@favonia
Copy link

favonia commented Jul 22, 2017

Version

pacaur 4.7.10

Description

If the user is asking pacaur to sync the database, pacaur should sync the database before determining whether it should look into AUR or not. The text below intentionally deletes the database first to make it reproducible, but the problem will also occur when the user is syncing the database for the first time, or when some new packages are just added.

Output
$ sudo rm /var/lib/pacman/sync/multilib.db

$ pacaur -Sy smlnj
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib                                                171.6 KiB   350K/s 00:00 [##############################################] 100%
:: Package smlnj not found in repositories, trying AUR...
:: resolving dependencies...
:: no results found for smlnj

$ pacaur -Sy smlnj
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
resolving dependencies...
looking for conflicting packages...

Package (2)           New Version  Net Change  Download Size

multilib/lib32-glibc  2.25-4        14.22 MiB       2.88 MiB
multilib/smlnj        110.81-1      34.99 MiB       7.89 MiB

Total Download Size:   10.76 MiB
Total Installed Size:  49.21 MiB

:: Proceed with installation? [Y/n]
Debug output

I only show the run right after deleting the database because that is the interesting one.

+ version=4.7.10
+ unset aur cleancache devel edit info installpkg foreign needed noconfirm nodeps noedit
+ unset operation pac pacQ pacS quiet rebuild refresh repo search selective upgrade
+ LC_COLLATE=C
+ TEXTDOMAIN=pacaur
+ TEXTDOMAINDIR=/usr/share/locale
+ [[ -n '' ]]
+ configdir=/etc/xdg/pacaur
+ userconfigdir=/home/favonia/.config/pacaur
+ userpacmandir=/home/favonia/.config/pacman
+ usercachedir=/home/favonia/.cache/pacaur
+ tmpdir=/run/user/1000
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -r '' ]]
+ source /etc/makepkg.conf
++ DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' 'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' 'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' 'rsync::/usr/bin/rsync --no-motd -z %u %o' 'scp::/usr/bin/scp -C %u %o')
++ VCSCLIENTS=('bzr::bzr' 'git::git' 'hg::mercurial' 'svn::subversion')
++ CARCH=x86_64
++ CHOST=x86_64-pc-linux-gnu
++ CPPFLAGS=-D_FORTIFY_SOURCE=2
++ CFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt'
++ CXXFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt'
++ LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
++ DEBUG_CFLAGS='-g -fvar-tracking-assignments'
++ DEBUG_CXXFLAGS='-g -fvar-tracking-assignments'
++ BUILDENV=(!distcc color !ccache check !sign)
++ OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
++ INTEGRITY_CHECK=(md5)
++ STRIP_BINARIES=--strip-all
++ STRIP_SHARED=--strip-unneeded
++ STRIP_STATIC=--strip-debug
++ MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
++ DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
++ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
++ COMPRESSGZ=(gzip -c -f -n)
++ COMPRESSBZ2=(bzip2 -c -f)
++ COMPRESSXZ=(xz -c -z -)
++ COMPRESSLRZ=(lrzip -q)
++ COMPRESSLZO=(lzop -q)
++ COMPRESSZ=(compress -c -f)
++ PKGEXT=.pkg.tar.xz
++ SRCEXT=.src.tar.gz
+ [[ -r /home/favonia/.config/pacman/makepkg.conf ]]
+ [[ -r /home/favonia/.makepkg.conf ]]
+ PACMAN=
+ PKGDEST=
+ SRCDEST=
+ SRCPKGDEST=
+ LOGDEST=
+ BUILDDIR=
+ PKGEXT=.pkg.tar.xz
+ SRCEXT=.src.tar.gz
+ GPGKEY=
+ PACKAGER=
+ CARCH=x86_64
+ editor=vim
+ displaybuildfiles=diff
+ fallback=true
+ silent=false
+ sortby=popularity
+ sortorder=descending
+ sudoloop=true
+ pacmanbin=pacman
+ clonedir=/home/favonia/.cache/pacaur
+ aururl=aur.archlinux.org
+ aurrpc='/rpc/?type=info&v=5'
+ source /etc/xdg/pacaur/config
+ [[ -r /home/favonia/.config/pacaur/config ]]
+ [[ ! -d /home/favonia/.cache/pacaur ]]
+ declare -A jsoncache
+ trap Cancel INT
+ args=($@)
+ for i in "${args[@]}"
+ [[ -Sy =~ ^-[a-zA-Z0-9] ]]
+ opts+=($i)
+ for i in "${args[@]}"
+ [[ smlnj =~ ^-[a-zA-Z0-9] ]]
+ count=0
+ [[ -n -Sy ]]
+ getopts sidmykufecqrahvxVDFQRSTUbglnoptw-: OPT
+ pacmanarg+=("-$OPT")
+ case "$OPT" in
+ pacS=1
+ operation=sync
+ [[ -Sy =~ w ]]
+ installpkg=true
+ [[ -Sy =~ g ]]
+ [[ -Sy =~ l ]]
+ [[ -Sy =~ p ]]
+ getopts sidmykufecqrahvxVDFQRSTUbglnoptw-: OPT
+ pacmanarg+=("-$OPT")
+ case "$OPT" in
+ [[ -n 1 ]]
+ operation=sync
+ refresh=true
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n 1 ]]
+ continue
+ getopts sidmykufecqrahvxVDFQRSTUbglnoptw-: OPT
+ [[ -z smlnj ]]
+ pkgs+=("${!OPTIND}")
+ shift 2
+ OPTIND=1
+ [[ -n '' ]]
++ grep '^Color' /etc/pacman.conf
+ [[ -n Color ]]
+ [[ '' != \n\e\v\e\r ]]
+ [[ '' = \a\l\w\a\y\s ]]
+ coweropts+=("--color=auto")
+ reset='\e[0m'
+ colorR='\e[1;31m'
+ colorG='\e[1;32m'
+ colorY='\e[1;33m'
+ colorB='\e[1;34m'
+ colorM='\e[1;35m'
+ colorC='\e[1;36m'
+ colorW='\e[1;39m'
+ pacmanarg=(${pacmanarg[@]/--/})
+ pacmanarg=(${pacmanarg[@]/-r/})
+ pacmanarg=(${pacmanarg[@]/-a/})
+ [[ sync = sync ]]
+ [[ ! -n '' ]]
+ [[ ! -n '' ]]
+ [[ ! -n '' ]]
+ [[ 1000 -eq 0 ]]
+ [[ -n 1 ]]
+ pacmanarg=(${pacmanarg[@]/-e/})
+ [[ -n 1 ]]
+ [[ -n '' ]]
+ [[ -n 1 ]]
+ [[ -n '' ]]
++ command -v vim
+ [[ ! -n /home/favonia/scripts/vim ]]
++ basename pacaur
+ [[ '' = pacaur ]]
+ [[ ! -w /home/favonia/.cache/pacaur ]]
+ [[ -z smlnj ]]
+ [[ -z smlnj ]]
+ [[ -n '' ]]
+ case $operation in
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -z smlnj ]]
+ ClassifyPkgs smlnj
+ local noaurpkgs norepopkgs
+ [[ true = true ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ ! -n '' ]]
+ [[ ! -n '' ]]
+ unset noaurpkgs
+ for i in "${pkgs[@]}"
+ [[ smlnj == aur/* ]]
+ noaurpkgs+=($i)
+ [[ -n smlnj ]]
+ norepopkgs=($(LANG=C $pacmanbin -Sp ${noaurpkgs[@]} 2>&1 >/dev/null | awk '{print $NF}'))
++ LANG=C
++ pacman -Sp smlnj
++ awk '{print $NF}'
+ for i in "${norepopkgs[@]}"
+ [[ !  smlnj  =~ [a-zA-Z0-9.+-]+/smlnj[^a-zA-Z0-9.+-] ]]
+ aurpkgs+=($i)
+ repopkgs=($(grep -xvf <(printf '%s\n' "${aurpkgs[@]}") <(printf '%s\n' "${noaurpkgs[@]}")))
++ grep -xvf /dev/fd/63 /dev/fd/62
+++ printf '%s\n' smlnj
+++ printf '%s\n' smlnj
+ [[ -n '' ]]
+ [[ -n smlnj ]]
+ [[ -n true ]]
+ [[ -z '' ]]
+ sudo pacman -Sy
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib                                                171.6 KiB   335K/s 00:01 [##############################################] 100%
+ [[ true = true ]]
+ [[ ! -n '' ]]
+ [[ 1 -gt 1 ]]
+ Note w 'Package \e[1;39msmlnj\e[0m not found in repositories, trying \e[1;35mAUR\e[0m...'
+ case "$1" in
+ echo -e '\e[1;33m::\e[0m Package \e[1;39msmlnj\e[0m not found in repositories, trying \e[1;35mAUR\e[0m...'
:: Package smlnj not found in repositories, trying AUR...
+ Core
+ GetIgnoredPkgs
+ ignoredpkgs+=($(grep '^IgnorePkg' '/etc/pacman.conf' | awk -F '=' '{print $NF}' | tr -d "'\""))
++ grep '^IgnorePkg' /etc/pacman.conf
++ awk -F = '{print $NF}'
++ tr -d ''\''"'
+ [[ -e /home/favonia/.config/cower/config ]]
+ ignoredpkgs=(${ignoredpkgs[@]//,/ })
+ GetIgnoredGrps
+ ignoredgrps+=($(grep '^IgnoreGroup' '/etc/pacman.conf' | awk -F '=' '{print $NF}' | tr -d "'\""))
++ grep '^IgnoreGroup' /etc/pacman.conf
++ awk -F = '{print $NF}'
++ tr -d ''\''"'
+ ignoredgrps=(${ignoredgrps[@]//,/ })
+ [[ -n '' ]]
+ IgnoreChecks
+ local checkaurpkgs checkaurpkgsAver checkaurpkgsAgrp checkaurpkgsQver checkaurpkgsQgrp i json
+ [[ -z '' ]]
+ [[ -z '' ]]
+ return
+ DepsSolver
+ local i aurpkgsname aurpkgsver aurpkgsaurver aurpkgsconflicts
+ Note i 'resolving dependencies...'
+ case "$1" in
+ echo -e '\e[1;34m::\e[0m resolving dependencies...'
:: resolving dependencies...
+ for i in "${!aurpkgs[@]}"
++ awk -F '>|<|=' '{print $1}'
+ aurpkgsnover[$i]=smlnj
+ SetJson smlnj
+ [[ 1 -eq 0 ]]
+ [[ -z '' ]]
++ DownloadJson smlnj
++ local urlencodedpkgs urlargs urlcurl urlarg urlmax j
++ urlencodedpkgs=($(sed 's/+/%2b/g;s/@/%40/g' <<< $@))
+++ sed 's/+/%2b/g;s/@/%40/g'
++ urlarg='&arg[]='
+++ printf '&arg[]=%s' smlnj
++ urlargs='&arg[]=smlnj'
++ urlmax=4400
++ [[ 12 -lt 4400 ]]
++ curl -sfg --compressed -C 0 'https://aur.archlinux.org/rpc/?type=info&v=5&arg[]=smlnj'
+ jsoncache[$@]='{"version":5,"type":"multiinfo","resultcount":0,"results":[]}'
+ json='{"version":5,"type":"multiinfo","resultcount":0,"results":[]}'
+ aurpkgsproviders=(${aurpkgsnover[@]})
+ aurpkgsproviders+=($(GetJson "array" "$json" "Provides"))
++ GetJson array '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Provides
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/^"Provides"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ sed 's/] /]\n/g'
++ cut '-d ' -f 2-
++ tr -d '[]"'
++ tr -d '\n'
+ for i in "${!aurpkgsproviders[@]}"
++ awk -F '>|<|=' '{print $1}'
+ aurpkgsproviders[$i]=smlnj
+ aurpkgsconflicts=($(GetJson "array" "$json" "Conflicts"))
++ GetJson array '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Conflicts
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/^"Conflicts"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ sed 's/] /]\n/g'
++ tr -d '[]"'
++ cut '-d ' -f 2-
++ tr -d '\n'
+ [[ -n '' ]]
+ deps=(${aurpkgsnover[@]})
+ [[ -z '' ]]
+ foreignpkgs=($($pacmanbin -Qmq))
++ pacman -Qmq
+ FindDepsAur smlnj
+ local depspkgs depspkgstmp depspkgsaurtmp repodepstmp builtpkg vcsdepspkgs assumedepspkgs
+ local aurversionpkgs aurversionpkgsname aurversionpkgsver aurversionpkgsaurver i j json
+ [[ -n '' ]]
+ unset aurversionpkgs
+ [[ -z '' ]]
+ SetJson smlnj
+ [[ 1 -eq 0 ]]
+ [[ -z {"version":5,"type":"multiinfo","resultcount":0,"results":[]} ]]
+ json='{"version":5,"type":"multiinfo","resultcount":0,"results":[]}'
+ aurversionpkgs=(${aurpkgs[@]})
+ [[ -n smlnj ]]
+ for i in "${!aurversionpkgs[@]}"
+ unset aurversionpkgsname aurversionpkgsver aurversionpkgsaurver
+ aurversionpkgsname=smlnj
+ aurversionpkgsname=smlnj
+ aurversionpkgsname=smlnj
+ aurversionpkgsver=smlnj
+ aurversionpkgsver=smlnj
+ aurversionpkgsver=smlnj
++ GetJson varvar '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Version smlnj
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/"Name":"smlnj"/,/}/!d'
++ tr -d '"'
++ grep -Po 'Version:.*'
++ sed -r s/Version:/Version#/g
++ awk -F '#' '{print $2}'
+ aurversionpkgsaurver=
+ [[ ! -n '' ]]
+ [[ !    =~  smlnj  ]]
+ errdeps+=(${aurversionpkgs[$i]})
+ continue
+ depspkgs=($(GetJson "array" "$json" "Depends"))
++ GetJson array '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Depends
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/^"Depends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ sed 's/] /]\n/g'
++ cut '-d ' -f 2-
++ tr -d '[]"'
++ tr -d '\n'
+ [[ ! -n '' ]]
+ depspkgs+=($(GetJson "array" "$json" "MakeDepends"))
++ GetJson array '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' MakeDepends
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/^"MakeDepends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ sed 's/] /]\n/g'
++ cut '-d ' -f 2-
++ tr -d '\n'
++ tr -d '[]"'
+ depspkgs+=($(GetJson "array" "$json" "CheckDepends"))
++ GetJson array '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' CheckDepends
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/^"CheckDepends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ cut '-d ' -f 2-
++ sed 's/] /]\n/g'
++ tr -d '[]"'
++ tr -d '\n'
+ [[ -n smlnj ]]
+ depspkgs=($(grep -xvf <(printf '%s\n' "${aurpkgsproviders[@]}") <(printf '%s\n' "${depspkgs[@]}")))
++ grep -xvf /dev/fd/63 /dev/fd/62
+++ printf '%s\n' smlnj
+++ printf '%s\n'
+ [[ x86_64 == \i\6\8\6 ]]
+ [[ ! -n '' ]]
+ [[ ! -n '' ]]
+ depspkgs=($($pacmanbin -T ${depspkgs[@]} | sort -u))
++ pacman -T
++ sort -u
+ unset depspkgsaur
+ [[ -n '' ]]
+ unset depspkgs
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ deps=($(grep -xvf <(printf '%s\n' "${aurdepspkgs[@]}") <(printf '%s\n' "${deps[@]}")))
++ grep -xvf /dev/fd/63 /dev/fd/62
+++ printf '%s\n'
+++ printf '%s\n' smlnj
+ deps+=(${aurdepspkgs[@]})
+ SetJson smlnj
+ [[ 1 -eq 0 ]]
+ [[ -z {"version":5,"type":"multiinfo","resultcount":0,"results":[]} ]]
+ json='{"version":5,"type":"multiinfo","resultcount":0,"results":[]}'
+ SortDepsAur smlnj
+ local i j sortaurpkgs sortdepspkgs sortdepspkgsaur
+ [[ -z '' ]]
+ sortaurpkgs=(${aurpkgs[@]})
+ unset checkedsortdepspkgsaur
+ for i in "${!sortaurpkgs[@]}"
+ unset sortdepspkgs sortdepspkgsaur
+ sortdepspkgs+=($(GetJson "arrayvar" "$json" "Depends" "${sortaurpkgs[$i]}"))
++ GetJson arrayvar '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Depends smlnj
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/"Name":"smlnj"/,/}/!d'
++ sed -e '/^"Depends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ tr -d '[]'
++ cut '-d ' -f 2-
+ sortdepspkgs+=($(GetJson "arrayvar" "$json" "MakeDepends" "${sortaurpkgs[$i]}"))
++ GetJson arrayvar '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' MakeDepends smlnj
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/"Name":"smlnj"/,/}/!d'
++ sed -e '/^"MakeDepends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ cut '-d ' -f 2-
++ tr -d '[]'
+ sortdepspkgs+=($(GetJson "arrayvar" "$json" "CheckDepends" "${sortaurpkgs[$i]}"))
++ GetJson arrayvar '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' CheckDepends smlnj
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d ', '
++ sed -e '/"Name":"smlnj"/,/}/!d'
++ sed -e '/^"CheckDepends"/,/]/!d'
++ tr -d '\"'
++ tr '\n' ' '
++ cut '-d ' -f 2-
++ tr -d '[]'
+ for j in "${!errdeps[@]}"
++ awk -F '>|<|=' '{print $1}'
+ errdepsnover[$j]=smlnj
+ [[ -z '' ]]
+ tsortdeps+=("${sortaurpkgs[$i]} ${sortaurpkgs[$i]}")
+ sortdepspkgsaur=($(grep -xvf <(printf '%s\n' "${allcheckedsortdepspkgsaur[@]}") <(printf '%s\n' "${sortdepspkgsaur[@]}")))
+++ printf '%s\n'
++ grep -xvf /dev/fd/63 /dev/fd/62
+++ printf '%s\n'
+ [[ -n '' ]]
+ [[ -n '' ]]
+ deps=($(tsort <<< ${tsortdeps[@]}))
++ tsort
+ (( 0 > 0 ))
+ depsAname=($(GetJson "var" "$json" "Name"))
++ GetJson var '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Name
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d '", '
++ grep -Po 'Name:.*'
++ sed -r s/Name:/Name#/g
++ awk -F '#' '{print $2}'
+ depsAver=($(GetJson "var" "$json" "Version"))
++ GetJson var '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Version
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d '", '
++ grep -Po 'Version:.*'
++ sed -r s/Version:/Version#/g
++ awk -F '#' '{print $2}'
+ depsAood=($(GetJson "var" "$json" "OutOfDate"))
++ GetJson var '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' OutOfDate
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d '", '
++ grep -Po 'OutOfDate:.*'
++ sed -r s/OutOfDate:/OutOfDate#/g
++ awk -F '#' '{print $2}'
+ depsAmain=($(GetJson "var" "$json" "Maintainer"))
++ GetJson var '{"version":5,"type":"multiinfo","resultcount":0,"results":[]}' Maintainer
++ json_verify -q
++ case "$1" in
++ json_reformat
++ tr -d '", '
++ grep -Po 'Maintainer:.*'
++ sed -r s/Maintainer:/Maintainer#/g
++ awk -F '#' '{print $2}'
+ [[ -n smlnj ]]
+ for i in "${!errdepsnover[@]}"
+ [[  smlnj  =~  smlnj  ]]
+ Note f 'no results found for smlnj'
+ case "$1" in
+ echo -e '\e[1;31m::\e[0m no results found for smlnj'
:: no results found for smlnj
+ exit 1
@rmarquis
Copy link
Owner

I see. This requires a redesign of the initial operation handling code, delaying to pacaur 5.
Thanks for the report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants