You are not logged in.
Pages: 1
I would be interested to see the problems resulting from actually running an -Syu after not running one for such a long period of time. I've seen multiple threads started here that resulted from not ever running it and then suddenly doing so
re: running it every hour to see if there's an update, I just have cron check hourly and conky tell me if there's Arch or AUR updates
# Split off from a TGN'ed thread...
Last edited by jasonwryan (2014-07-08 22:58:50)
Offline
I just have cron check hourly and conky tell me if there's Arch or AUR updates
You mean with "/usr/bin/checkupdates"? I do that too. It's sooo much nicer having conky just tell me if I need to do an update.
Offline
no, I use a custom script because when I wrote it I couldn't find any built-in mechanism to check it and it works without any problems so I haven't changed it
Offline
no, I use a custom script because when I wrote it I couldn't find any built-in mechanism to check it and it works without any problems so I haven't changed it
Note that this can cause issues, because if you don't do a sysupgrade right after, you have still sync-ed your dbs, so your next install (-S) is really a -Sy which isn't good. Hence checkupdates.
(Also it seems your script can't deal with updates for both (repo) packages & AUR packages at the same time. Also grep can count (-c) then you can drop the `|wc -l`)
Offline
I tried updating a rarely used machine from a year later, and kabooley, it wanted all kinds of intermediate packages and their dependencies. I just reinstalled from scratch, it wasn't an essential install.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
Note that this can cause issues, because if you don't do a sysupgrade right after, you have still sync-ed your dbs, so your next install (-S) is really a -Sy which isn't good. Hence checkupdates.
the man page says that it doesn't actually do anything
-p, --print
Only print the targets instead of performing the actual operation (sync, remove or upgrade). Use --print-format to specify how targets are
displayed. The default format string is "%l", which displays URLs with -S, filenames with -U and pkgname-pkgver with -R.
(Also it seems your script can't deal with updates for both (repo) packages & AUR packages at the same time.
that's OK, my conky script uses human language (i.e. "2 AUR Updates Available!"), so it doesn't need to display both
Also grep can count (-c) then you can drop the `|wc -l`)
good to know, I hadn't considered that before now. I'm always finding little shortcuts to trim my one liners
Offline
The 'p' affects the 'u' portion, not the 'y' portion. You're syncing the databases to be able to get the list.
Offline
The other reason to use the official "checkupdates" application is because if conky is checking for updates then you won't be able to use pacman to install or remove software.
...which is rare that it would ever happen, but it could happen!
Offline
The other reason to use the official "checkupdates" application is because if conky is checking for updates then you won't be able to use pacman to install or remove software.
...which is rare that it would ever happen, but it could happen!
It might conk your system!
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
Also grep can count (-c) then you can drop the `|wc -l`)
<head explodes>
Thank you for posting!
Offline
no, I use a custom script because when I wrote it I couldn't find any built-in mechanism to check it and it works without any problems so I haven't changed it
I slapped together pretty much the same thing a couple weeks ago, but with the reasons jakobcreutzfeldt mentioned in mind:
#!/usr/bin/env bash
# Run '/usr/bin/checkupdates' to get a count of the number of pending package
# updates. If the number is 20 or greater, or a kernel update is pending, print
# the number of updates to the statusbar and send a pop-up notification.
# Otherwise, exit silently.
pkg=$(checkupdates | wc -l)
kernel=$(checkupdates | grep -c ^linux$)
if [ "$pkg" -lt 20 ] && [ "$kernel" -eq 0 ]; then
exit 0
elif [ "$pkg" -ge 20 ] || [ "$kernel" -ge 1 ]; then
notify-send "Pending updates:" "$(checkupdates)";
echo "PACKAGES: [ $pkg ]"
fi
'grep -oc linux' would obviously catch any package with "linux" in the name, but since the kernel and headers are updated more often than all the rest I got lazy.
EDIT: I also use "alias pacin=sudo pacman -Syu", so if I install a package from the official repos the system just gets updated as a matter of course.
EDIT2: Updated with slithery's recommendation.
Last edited by ANOKNUSA (2014-07-08 21:42:58)
Offline
'grep -oc linux' would obviously catch any package with "linux" in the name
grep -oc ^linux$
Offline
ANOKNUSA wrote:'grep -oc linux' would obviously catch any package with "linux" in the name
grep -oc ^linux$
Awesome, thanks a lot. And while testing your recommendation I realized that the '-o' flag output is suppressed when using '-c' anyway, so 'grep -c' is all that's needed.
Offline
I slapped together pretty much the same thing a couple weeks ago...
Why rerun checkupdates when you can just read from the db? Run checkupdates as a cron job every $x hours, and poll the /tmp db every $x minutes for your statusbar.
pup="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
if (( pup > 0 )); then
echo -en "$pup"
else
echo "0"
fi
Offline
ANOKNUSA wrote:'grep -oc linux' would obviously catch any package with "linux" in the name
grep -oc ^linux$
Of course, that would only match the linux package. Try
grep -c '\<linux\>'
This silver ladybug at line 28...
Offline
@ANOKNUSA, as you specify bash as the interpreter, there is no reason to use the separate process `[' for the tests - use the `[[' bash builtin. This will save spawning a few extra sub-processes.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Why rerun checkupdates when you can just read from the db? Run checkupdates as a cron job every $x hours, and poll the /tmp db every $x minutes for your statusbar.
Good call. It's pretty senseless to run 'chekcupdates' more than once. As for the statusbar, my statusline is dynamically built using i3blocks. All "blocks" are separate scripts run independently at different intervals; only the clock and a task reminder are shown constantly, while everything else only appears when certain conditions are met. My 'pkgup' script runs once every four hours and only provides output when the number of updates reaches 20+ or a kernel update is available, so I may as well just update the temporary database within the script.
@lolilolicon: linux and linux-headers get updated simultaneously, so I only need to know when one package is ready.
@ Trillby: Thanks. I suppose since the package counts are integers I don't need the double quotes either.
Offline
@lolilolicon: linux and linux-headers get updated simultaneously, so I only need to know when one package is ready.
Ah I see, you only want to catch the kernel packages. This seems to be a reasonable assumption; I think it's more reliable to catch the linux-*-headers packages, if you have installed other kernels such as linux-lts (which you want to catch too), since there are packages like linux-howtos. It seems linux-api-headers should be excluded too.
pcregrep '^linux(-[^-\s]+)*(?<!-api)-headers$'
EDIT: except if you don't have the corresponding -headers package installed
EDIT²: https://xkcd.com/1313/
Last edited by lolilolicon (2014-07-09 04:49:38)
This silver ladybug at line 28...
Offline
Pages: 1