Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow changing the separator between licenses; Allow running on a different root directory #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ddurst-purestorage
Copy link

These changes clean up dpkg-licenses a bit, provide the ability to change the separator placed between licenses, and grant the ability to run dpkg-licenses on an unpacked or mounted Debian or Ubuntu rootfs.

Cleanup

Trim trailing whitespace and place the code to find copyright files into its own script inside libdir. The parsers source the new script.

Changing separators

Fixes #6

The default separator is still the space character to maintain the status quo. Using the double quote character as a separator definitely breaks the CSV output. Other characters probably do, too.

Example cmdline output

$ ./dpkg-licenses --separator='|' | head
St  Name                           Version                        Arch   Description                                                  Licenses
--  ----                           -------                        ----   -----------                                                  --------
ii  2to3                           3.8.2-0ubuntu2                 all    2to3 binary using python3                                    GPL-compatible|GPL-compatible licenses
ii  accountsservice                0.6.55-0ubuntu12~20.04.5       amd64  query and manipulate user account information                GPL-2+|GPL-3+
ii  acl                            2.2.53-6                       amd64  access control list - utilities                              GPL-2+|LGPL-2+
ii  adduser                        3.118ubuntu2                   all    add and remove users and groups                              GPL-2
ii  adwaita-icon-theme             3.36.1-2ubuntu0.20.04.2        all    default icon theme of GNOME (small subset)                   GFDL-1.2|GPL|LGPL-3
ii  alpine                         2.22+dfsg1-1                   amd64  Text-based email client, friendly for novices but powerful   Apache-2.0|BSD-4-Clause-UC|Expat-Bellcore|GPL-2+|NTP
ii  alpine-doc                     2.22+dfsg1-1                   all    Text-based email client's documentation                      Apache-2.0|BSD-4-Clause-UC|Expat-Bellcore|GPL-2+|NTP
ii  alsa-topology-conf             1.2.2-1                        all    ALSA topology configuration files                            BSD-3-clause

Example csv output

$ ./dpkg-licenses --separator='|' -c | head
"St","Name","Version","Arch","Description","Licenses"
"ii","2to3","3.8.2-0ubuntu2","all","2to3 binary using python3","GPL-compatible|GPL-compatible licenses"
"ii","accountsservice","0.6.55-0ubuntu12~20.04.5","amd64","query and manipulate user account information","GPL-2+|GPL-3+"
"ii","acl","2.2.53-6","amd64","access control list - utilities","GPL-2+|LGPL-2+"
"ii","adduser","3.118ubuntu2","all","add and remove users and groups","GPL-2"
"ii","adwaita-icon-theme","3.36.1-2ubuntu0.20.04.2","all","default icon theme of GNOME (small subset)","GFDL-1.2|GPL|LGPL-3"
"ii","alpine","2.22+dfsg1-1","amd64","Text-based email client, friendly for novices but powerful","Apache-2.0|BSD-4-Clause-UC|Expat-Bellcore|GPL-2+|NTP"
"ii","alpine-doc","2.22+dfsg1-1","all","Text-based email client's documentation","Apache-2.0|BSD-4-Clause-UC|Expat-Bellcore|GPL-2+|NTP"
"ii","alsa-topology-conf","1.2.2-1","all","ALSA topology configuration files","BSD-3-clause"
"ii","alsa-ucm-conf","1.2.2-1ubuntu0.13","all","ALSA Use Case Manager configuration files","BSD-3-clause"

Alternate root

Run dpkg-licenses on an unpacked or mounted Ubuntu system without mutating its state by copying in the script files and chrooting.

dpkg-licenses still has to run on a system with dpkg installed, but this makes it much easier to use when building a Debian system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper separator character to license list
1 participant