apt-get dist-upgrade output format question
Hello,
I am not sure if this is the right place to ask this, apologies if it's
not.
My question is, how reliable is the exact output format of
"apt-get -s dist-upgrade", meaning is it safe to parse the "head section"
of the output in a script to extract information about what would happen
on a real upgrade or is the format possibly changed in future versions?
By "head section" I mean of course the part that reads like:
The following packages will be REMOVED:
pkg1 pkg2
The following NEW packages will be installed:
pkg3 pkg4
The following packages have been kept back:
pkg5 pkg6
The following packages will be upgraded:
pkg7 pkg8 pkg9
Background:
I want to write a script that checks which packages are pending an
upgrade, similar to what apticron does, however I want to collect
additional information about which packages would be newly installed,
removed or kept back during an apt-get dist-upgrade.
Now the only thing I was able to find documented about the output of
"apt-get -s dist-upgrade" is that it can be parsed for lines beginning
with "Inst" or "Remv" to find out what will happen (as apticron does),
which means that a number of other calls to apt-* commands is required to
sort out which packages will actually be upgraded/newly installed/kept
back. This seems a little awkward though, since apt-get -s dist-upgrade
apparently prints out all the necessary information, only that the format
of the output is not documented (or if it is, I could not find where).
Thanks in advance
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
Another dream that failed. There's nothing sadder.
-- Kirk, "This side of Paradise", stardate 3417.3
Reply to: