You are not logged in.
I'm working on a script and was wondering if someone has thought of a better way to do this. I'm working on a script that will re-install packages from my local cache (i.e. AUR packages) and would like to compare them to the online version. If the online version matches the one in the cache then install the cached version. I believe it should work but gotten a bit too complex last night. To this point so was wondering if there might be a better way to do it. Here's the relevant snippet:
pkgandver="${pkg}-$(packer -Si $pkg | grep Version | awk '{ printf $3 }')"
Guess it's not that ugly but thought there might be a better way to do it, or should I just leave it be?
Last edited by Gen2ly (2010-03-28 17:57:41)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
How about not using packer...
aur_version() {
wget -q -O- "http://aur.archlinux.org/rpc.php?type=info&arg=${1}" | sed 's/.*"Version":"\([^"]*\)".*/\1/')
}
local_version() {
pacman -Q ${1} | cut -d\ -f2
}
Last edited by lolilolicon (2010-03-16 18:15:13)
This silver ladybug at line 28...
Offline
Sorry, took so long to get back lolilolicon, been having a few computer oddities. I'll try these tomorrow and get back. For local_version I noticed the delimiter is \, I think you meant " ", yes????
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
Welcome back Gen2ly.
Yes, it was " ". I put two spaces between \ and -, I'm casual with escaping (possibly for less typing in this case... )
This silver ladybug at line 28...
Offline
Ah, these will help quite a bit - both work great. Much appreciated, lolilolicon.
Last edited by Gen2ly (2010-03-28 17:57:16)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline