Marking as solved.
]]>No I get asked for a password even if I immediately repeat the command when it must already be in the cache.
Is that down to your sudo setting? I get asked first time, but subsequent times I don't as sudo has not yet timed out.
That may be why others aren't getting it - also if they've added pacman to the list of commands that don't require a password.
This script is pretty old and if I'm reading it right, it hasn't been touched since creation https://projects.archlinux.org/pacman.g … pacscripts
]]>I'm tempted to feel it should not really download to pacman's cache anyway but use a temporary directory just because it is supposed to be providing information and it seems a bit odd to download to pacman's "real" cache for that if the package isn't installed an may never be installed on the system. But I guess there are advantages to its being as it is.
]]>spacman() {
if [ $EUID -eq 0 ]; then
pacman "$@"
else
if ! type -p sudo; then
error "Cannot find the sudo binary! Is sudo installed?"
error "Otherwise try to run the program as root"
exit 1
else
sudo pacman "$@"
fi
fi
}
and then
url=$(spacman -Sdp $1 | tail -n1)
filename=$(basename $url)
if [ ! -f "$pac_cache/$filename" ]; then
if ! spacman -Sdw --noconfirm $1 >&2; then
error "Failed to download $1"
return 1
fi
echo >&2
fi
I don't see the reason to run 'sudo pacman -Sdp $1 | tail -n1', just 'pacman' should be enough.
I'll ask on the ML.
Do you not get asked for a password? I got asked for one twice so gconf-editor took 25 secs but most of that was me typing...
Maybe because you didn't have gconf-editor in your cache and it had to be downloaded first.
No password prompts but
$ pacscripts gconf-editor
/usr/bin/sudo
resolving dependencies...
Packages (10):
...
bsdtar -xOf /var/cache/pacman/pkg/chromium-27.0.1453.110-1-i686.pkg.tar.xz .INSTALL
to
bsdtar -xqOf /var/cache/pacman/pkg/chromium-27.0.1453.110-1-i686.pkg.tar.xz .INSTALL
(added '-q' switch) makes it better :-)
$ time bsdtar -xqOf /var/cache/pacman/pkg/chromium-27.0.1453.110-1-i686.pkg.tar.xz .INSTALL
post_install() {
xdg-icon-resource forceupdate --theme hicolor &>/dev/null
update-desktop-database -q
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}
real 0m0.036s
user 0m0.023s
sys 0m0.004s
but I have no idea if it breaks anything.
-q, --fast-read
(x and t mode only) Extract or list only the first archive entry that matches each pattern or filename oper‐
and. Exit as soon as each specified pattern or filename has been matched. By default, the archive is always
read to the very end, since there can be multiple entries with the same name and, by convention, later entries
overwrite earlier entries. This option is provided as a performance optimization.
Have you already tried defragmentating the pacman db with pacman-optimize?
Yup, many times. I haven't noticed any change.
]]>The sloooow one is not a huge deal, I'm just a curious little kitty and I would like to know.
]]>