It happens quite often that I use synaptic to manage packages on my debian.
However, sometime I save the markings in order to perform the installations another time.
For example I need to apt-get something quickly without waiting for the whole thing to be
downloaded and installed.
The standard procedure would be running synaptic again and then loading the markings.
However, in this cases I don’t feel like I need to start the whole synaptic thing.
I’d prefer a small command line utility that processes the saved markings.
I wrote one. It is very simple. It uses sudo, so every now and then it asks the password.
Of course one could do a better job, but I had not time to do something better.
#!/usr/bin/env ruby
args = $*
if args.size == 0
puts "You should provide a file to process"
exit 0
end
dict = Hash.new
File.open(args[0]) do |f|
f.each_line do |line|
key, action = *line.split
dict[key] = action
end
end
# sudo apt-get #{v} #{k}
dict.each do |k, v|
exec(”sudo apt-get -y #{v} #{k}”) if fork.nil?
Process.wait
end
2 comments
Comments feed for this article
March 23rd, 2007 at 07:25
MazinKaesar
[OT]
Ciao, vedo che ancora posti sul blog, quindi sei ancora vivo e in circolazione? Akropolix invece รจ ormai kaput… possiamo risolverla questa situazione? Non esiste qualche altro tool per gestire i forum che resista meglio alla spam? Fatti vivo!!! Non solo sul blog, intendo, anche su Iksnet non ti si vede piu’! Ciao e scusa l’OT sul blog!
[/OT]
March 25th, 2007 at 06:46
Enrico Franchi
Si. Sono vivo e in circolazione. Per Akropolix possiamo gestirla come vuoi: io e Radome abbiamo pochissimo tempo: dimmi cosa vuoi e te lo metto a disposizione.