How to check if aptitude did something?

I've a CI build process during which I install a debian package from my local reprepro.

I have a Makefile which does call aptitude to install the package from its own repository like this

sudo aptitude -y install foobar >> aptitude.log 2>&1

Now it could happen that aptitude has conflicts, which can't be resolved or the repository doesn't offer a new version for the package "foobar". In both cases aptitude wouldn't install anything. But

echo $?

after the aptitude call in the Makefile always returns 0. What way do you propose to check if aptitude actually did install anything? Grepping for the last line of the aptitude output is the only thing I can think of if the exit codes are always 0.

2022-07-25 20:46:44
Source Share
Answers: 0