Skip to content

Division by zero error in pacgraph-tk for packages with no dependencies #4

@arunisaac

Description

@arunisaac

Consider a package with no dependencies, say tzdata.

When I run

pacgraph-tk tzdata

I get the following error message:

Loading repository.
warning: cron found in ['cronie', 'fcron'], assuming cronie
warning: netcat found in ['gnu-netcat', 'openbsd-netcat'], assuming gnu-netcat
warning: ttf-font found in ['ttf-bitstream-vera', 'ttf-dejavu', 'ttf-droid', 'ttf-freefont', 'ttf-liberation', 'ttf-linux-libertine', 'ttf-ubuntu-font-family'], assuming ttf-bitstream-vera
warning: d-runtime found in ['libgphobos-devel', 'liblphobos-devel', 'libphobos-devel'], assuming libgphobos-devel
warning: d-compiler found in ['dmd', 'gdc', 'ldc'], assuming dmd
warning: dhcp-client found in ['dhclient', 'dhcpcd'], assuming dhclient
warning: smtp-server found in ['exim', 'opensmtpd', 'postfix'], assuming exim
warning: smtp-forwarder found in ['esmtp', 'exim', 'msmtp-mta', 'nullmailer', 'opensmtpd', 'postfix', 'ssmtp'], assuming esmtp
warning: libreoffice-langpack found in ['libreoffice-af', 'libreoffice-am', 'libreoffice-ar', 'libreoffice-as', 'libreoffice-ast', 'libreoffice-be', 'libreoffice-bg', 'libreoffice-bn', 'libreoffice-bn-IN', 'libreoffice-bo', 'libreoffice-br', 'libreoffice-brx', 'libreoffice-bs', 'libreoffice-ca', 'libreoffice-ca-XV', 'libreoffice-cs', 'libreoffice-cy', 'libreoffice-da', 'libreoffice-de', 'libreoffice-dgo', 'libreoffice-dz', 'libreoffice-el', 'libreoffice-en-GB', 'libreoffice-en-US', 'libreoffice-en-ZA', 'libreoffice-eo', 'libreoffice-es', 'libreoffice-et', 'libreoffice-eu', 'libreoffice-fa', 'libreoffice-fi', 'libreoffice-fr', 'libreoffice-ga', 'libreoffice-gd', 'libreoffice-gl', 'libreoffice-gu', 'libreoffice-he', 'libreoffice-hi', 'libreoffice-hr', 'libreoffice-hu', 'libreoffice-id', 'libreoffice-is', 'libreoffice-it', 'libreoffice-ja', 'libreoffice-ka', 'libreoffice-kk', 'libreoffice-km', 'libreoffice-kn', 'libreoffice-ko', 'libreoffice-kok', 'libreoffice-ks', 'libreoffice-ku', 'libreoffice-lb', 'libreoffice-lo', 'libreoffice-lt', 'libreoffice-lv', 'libreoffice-mai', 'libreoffice-mk', 'libreoffice-ml', 'libreoffice-mn', 'libreoffice-mni', 'libreoffice-mr', 'libreoffice-my', 'libreoffice-nb', 'libreoffice-ne', 'libreoffice-nl', 'libreoffice-nn', 'libreoffice-nso', 'libreoffice-oc', 'libreoffice-om', 'libreoffice-or', 'libreoffice-pa-IN', 'libreoffice-pl', 'libreoffice-pt', 'libreoffice-pt-BR', 'libreoffice-ro', 'libreoffice-ru', 'libreoffice-rw', 'libreoffice-sa-IN', 'libreoffice-sat', 'libreoffice-sd', 'libreoffice-sh', 'libreoffice-si', 'libreoffice-sid', 'libreoffice-sk', 'libreoffice-sl', 'libreoffice-sq', 'libreoffice-sr', 'libreoffice-ss', 'libreoffice-st', 'libreoffice-sv', 'libreoffice-sw-TZ', 'libreoffice-ta', 'libreoffice-te', 'libreoffice-tg', 'libreoffice-th', 'libreoffice-tn', 'libreoffice-tr', 'libreoffice-ts', 'libreoffice-tt', 'libreoffice-ug', 'libreoffice-uk', 'libreoffice-uz', 'libreoffice-ve', 'libreoffice-vi', 'libreoffice-xh', 'libreoffice-zh-CN', 'libreoffice-zh-TW', 'libreoffice-zu'], assuming libreoffice-af
warning: phonon-backend found in ['phonon-gstreamer', 'phonon-vlc'], assuming phonon-gstreamer
Preparing 1 nodes.
Traceback (most recent call last):
  File "/usr/bin/pacgraph-tk", line 223, in <module>
    main()
  File "/usr/bin/pacgraph-tk", line 196, in main
    tree = pacgraph.pt_sizes(tree, 10, 100)
  File "/usr/bin/pacgraph", line 599, in pt_sizes
    tree[p].font_pt = convert(node.size)
  File "/usr/bin/pacgraph", line 597, in <lambda>
    convert = lambda s: int((max_pt-min_pt)*(s-min_s)/(max_s-min_s) + min_pt)
ZeroDivisionError: division by zero

There seems to be a division by zero error in the function converting package size to font pt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions