Tks. I am not a perl scripter, normally using Python. dpkg-query generating a CSV file fed into a custom script to compare two computers version lists is what I'm working on at the moment which is easier for me to maintain.

On 25/07/20 4:54 pm, Sebastiaan Couwenberg wrote:
On 7/25/20 1:39 AM, Patrick Dunford wrote:
OK I am not sure that is exactly what I want, the output looks like the
package list in the qgis web site where the packages are stored. What I
need is the version of each dependency which is actually on my computer now.
So you expand the logic to check if any of the listed dependencies are
installed, e.g.:

  for pkg_version in $(dpkg -l | grep qgis | grep ^ii | awk '{print
$2"="$3}'); do apt-cache show $pkg_version | egrep "Depends|Recommends"
| sed 's/^Depends: //; s/^Recommends: //' | perl -e 'my $input="";
while(<>){ $input .= $_; } foreach my $pkgs (split /, /, $input){ $pkgs
=~ s/ \(.*\)//; foreach my $pkg (split / \| /, $pkgs) { $pkg =~
s/:\S+//; system("dpkg -l $pkg"); } }'; done | grep ^ii | awk '{print
$2" "$3}'

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to