[Lsb-messages] /var/www/bzr/lsb/devel/componenttodb r50: Collect pkginfo when collecting info from installed distribution

Denis Silakov dsilakov at gmail.com
Wed Jun 15 14:25:48 UTC 2016


------------------------------------------------------------
revno: 50
committer: Denis Silakov <dsilakov at gmail.com>
branch nick: componenttodb
timestamp: Wed 2016-06-15 17:25:48 +0300
message:
  Collect pkginfo when collecting info from installed distribution
modified:
  distrtodb.pl
-------------- next part --------------
=== modified file 'distrtodb.pl'
--- a/distrtodb.pl	2016-06-09 16:03:00 +0000
+++ b/distrtodb.pl	2016-06-15 14:25:48 +0000
@@ -233,6 +233,25 @@
             print OUT "!CompDesc $CompDesc\n";
             print OUT "!CompURL $CompURL\n";
             close(OUT);
+            if( $opt_pkginfo ) {
+                if( $rpm ) {
+                    system "echo \!PkgProvides >> $OutputFile";
+                    system "rpm -q --nosignature --provides $CompName >> $OutputFile";
+                    system "echo \!PkgFiles >> $OutputFile";
+                    system "rpm -q --nosignature --list $CompName >> $OutputFile";
+                    system "echo \!PkgRequires >> $OutputFile";
+                    system "rpm -qR --nosignature $CompName | LC_ALL=C sort -u >> $OutputFile";
+                }
+                elsif( $deb ) {
+                    system "echo \!PkgProvides >> $OutputFile";
+                    system "dpkg-query --showformat='\${provides}' --show $CompName >> $OutputFile";
+                    system "echo \!PkgFiles >> $OutputFile";
+                    system "dpkg -L $CompName >> $OutputFile";
+                    system "echo \!PkgRequires >> $OutputFile";
+                    system "dpkg-query --showformat='\${depends}' --show $CompName >> $OutputFile";
+                    system "dpkg-query --showformat='\${pre-depends}' --show $CompName >> $OutputFile";
+                }
+            }
         }
     }
     else { # rpm or deb or tgz
@@ -353,6 +372,7 @@
                 system "dpkg-deb -c $filename >> $OutputFile";
                 system "echo \!PkgRequires >> $OutputFile";
                 system "dpkg-deb -f $filename depends >> $OutputFile";
+                system "dpkg-deb -f $filename pre-depends >> $OutputFile";
             }
         }
         system "rm ".$PkgBaseName."_upload_data";



More information about the lsb-messages mailing list