License finder?

Michael ODonnell michael.odonnell at comcast.net
Sat Nov 18 20:35:45 EST 2006




>> However, it also appears that dpkg does not maintain a "copyright"
>> or "license" field in the (installed) package information.
>
> I've looked into this a little more, and I'm more confident I'm
> correct.  The control information in /var/lib/dpkg/status does not
> contain license information, nor does the "control" file contained
> in the control.tar.gz file contained in a .deb archive file.

I think I can confirm that, at least to the extent that the
records in the Packages file(s) appear to have no field that's
specifically intended to record license info.

IIRC, the lists of packages available from a given server for a
given version are recorded in your /var/lib/apt/lists/*_Packages
files which can be queried something like this:

   function descriptionsOfallInstalledPkgs()  {
       COLUMNS=1000 dpkg -l      \
        | tr -s '[:blank:]' ' '  \
        | grep -r -e '^ii '      \
        | awk '{ print $2 }'     \
        | while read pkg
          do
              echo "#####################" BEGIN $pkg ;
              apt-cache show --full $pkg ;
              echo "#######################" END $pkg ;
          done
   }

   descriptionsOfallInstalledPkgs > /tmp/giganticListOfPkgDescriptions

...which will show you that some (but, disappointingly,
not nearly enough) Debian packages voluntarily report their
current licensing terms in the (very general) Description field.
 


More information about the gnhlug-discuss mailing list