Since the yum "bug" topic flooded the mailing list, this is a new post. A few days ago someone proposed a "yum --partial" feature in order to have partial updates instead of no updates - e.g if eclipse is broken, then why shouldn't httpd get updated?
Heres a quick "answer" :
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
Obviously this isn't too nice, but if someone has a better idea, this would allow fedora devel/test users to make automatic partial updates when dependencies are broken (quite often with the devel repositories). I don't expect a feature like this to be implemented in yum, since in the real world, we don't have broken dependencies (theoretically). Or should I write a yum plugin ... ?
------------------------------------------------------------------------ Szukasz pracy? Szukamy pracownikow: dziennikarzy, webmasterow, specjalisty ds. badan, promotion managera, administratorow baz danych, programistow Windows i wielu innych! >>> http://link.interia.pl/f18e6
cybernet@interia.pl wrote:
Since the yum "bug" topic flooded the mailing list, this is a new post. A few days ago someone proposed a "yum --partial" feature in order to have partial updates instead of no updates - e.g if eclipse is broken, then why shouldn't httpd get updated?
Heres a quick "answer" :
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
This has been added long back to http://fedoraproject.org/wiki/Tools/yum
regards Rahul
On Sun, 2005-12-11 at 12:24 +0100, cybernet@interia.pl wrote:
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
UUOTac? Try "sed '1,4d'" instead of the tac|head|tac stuff. Or better, use an awk range to filter the output:
awk '/^Setting up/,/^Updated Packages/{next};{print $1}'
Although this might be better, because it could be used with '-e 0 -d 0' consistently:
awk 'FNR==1,/^Updated Packages/ {next}; {print}'
Wil
Wil Cooley wrote:
On Sun, 2005-12-11 at 12:24 +0100, cybernet@interia.pl wrote:
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
UUOTac? Try "sed '1,4d'" instead of the tac|head|tac stuff. Or better, use an awk range to filter the output:
awk '/^Setting up/,/^Updated Packages/{next};{print $1}'
Although this might be better, because it could be used with '-e 0 -d 0' consistently:
awk 'FNR==1,/^Updated Packages/ {next}; {print}'
Wil
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
/Thomas
On Thu, 2005-12-15 at 22:42 +0100, Thomas M Steenholdt wrote:
Wil Cooley wrote:
On Sun, 2005-12-11 at 12:24 +0100, cybernet@interia.pl wrote:
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
UUOTac? Try "sed '1,4d'" instead of the tac|head|tac stuff. Or better, use an awk range to filter the output:
awk '/^Setting up/,/^Updated Packages/{next};{print $1}'
Although this might be better, because it could be used with '-e 0 -d 0' consistently:
awk 'FNR==1,/^Updated Packages/ {next}; {print}'
Wil
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
an EXCELLENT reason to never rely on screenscraping.
-sv
seth vidal wrote:
On Thu, 2005-12-15 at 22:42 +0100, Thomas M Steenholdt wrote:
Wil Cooley wrote:
On Sun, 2005-12-11 at 12:24 +0100, cybernet@interia.pl wrote:
# get a list of items # remove 4 lines from top (tac/head/tac) # try to update one item at a time for k in `yum list updates | awk '{ print $1 }' | tac | head -n-4 | tac`; do yum -y update $k; done
UUOTac? Try "sed '1,4d'" instead of the tac|head|tac stuff. Or better, use an awk range to filter the output:
awk '/^Setting up/,/^Updated Packages/{next};{print $1}'
Although this might be better, because it could be used with '-e 0 -d 0' consistently:
awk 'FNR==1,/^Updated Packages/ {next}; {print}'
Wil
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
an EXCELLENT reason to never rely on screenscraping.
-sv
Agreed! That's why something like this should work closer to yum!
/Thomas
On Thu, 2005-12-15 at 16:51 -0500, seth vidal wrote:
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
an EXCELLENT reason to never rely on screenscraping.
A tool not designed to be connected with other tools? Sounds like a disregard for one of the best UNIX design principles, to me.
Wil
Wil Cooley wrote:
On Thu, 2005-12-15 at 16:51 -0500, seth vidal wrote:
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
an EXCELLENT reason to never rely on screenscraping.
A tool not designed to be connected with other tools? Sounds like a disregard for one of the best UNIX design principles, to me.
Yum is more of an interactive program than a tool designed to be piped into something else - users want a nicely formatted output where the update is coming from, progress bars and such, all of which pretty much conflicts with piping to other programs (hence the "screen scraping" term).
You might want to try it with something that lets you format the output to your liking, for example ""repoquery --pkgnarrow=updates -a" and apply --queryformat to your liking.
- Panu -
On 12/21/05, Panu Matilainen pmatilai@laiskiainen.org wrote:
Wil Cooley wrote:
On Thu, 2005-12-15 at 16:51 -0500, seth vidal wrote:
The problem with any of these are that long package names gets mangled in the yum output and i haven't found a place to tweak that.
an EXCELLENT reason to never rely on screenscraping.
A tool not designed to be connected with other tools? Sounds like a disregard for one of the best UNIX design principles, to me.
Yum is more of an interactive program than a tool designed to be piped into something else - users want a nicely formatted output where the update is coming from, progress bars and such, all of which pretty much conflicts with piping to other programs (hence the "screen scraping" term).
Just because yum is interactive doesn't mean it shouldn't handle screen wrapping properly. Notice how `ls` (at least on my system) shows the results in columns with colours, but when you pipe it, it automatically outputs as a list without colours. I think this is to do with detecting the usage of /dev/tty or something (I can't remember). If python is not capable of doing that kind of thing I would be surprised.
n0dalus.