-
Notifications
You must be signed in to change notification settings - Fork 189
Description
Describe the bug
When there are packages installed with the same package manager using different commands in the same RUN command, the output report shows duplicate information about how the package information was collected for that package manager.
In the example below, the pip3 command is invoked twice in the same RUN command which causes Tern to print twice how pip3 package information was collected. We should remove this duplicate reporting and only report the package collection information once per RUN command.
Similarly, the same warning messages are also printed at the bottom of the report. In this case, the exact same warning message (warning: No listing method for 'copyrights'. Additional analysis may be required. No listing method for 'srcs'. Additional analysis may be required.) is printed three (!) times. This is redundant as the warning is generic and doesn't specify which package manager collection method the warning is referring to. Unless we add specific package manager information to these warnings, they should only be printed once per layer.
To Reproduce
Steps to reproduce the behavior:
- Build Tern's container using the Dockerfile in the repo.
- Run Tern on the tern image you built using the Dockerfile.
Error in terminal
Layer 2:
info: Instruction Line: RUN tdnf remove -y toybox && tdnf install -y tar findutils attr util-linux python3 python3-pip python3-setuptools git && pip3 install --upgrade pip && pip3 install tern
info: Layer created by commands: /bin/sh -c tdnf remove -y toybox && tdnf install -y tar findutils attr util-linux python3 python3-pip python3-setuptools git && pip3 install --upgrade pip && pip3 install tern
info: Retrieved by invoking listing in command_lib/base.yml
licenses:
in container:
tdnf check-update > /dev/null
pkgs=`tdnf list installed | cut -f1 -d"."`
for p in $pkgs; do tdnf info $p | head -10 | tail -1 | cut -f2 -d":" | xargs; done
names:
in container:
tdnf check-update > /dev/null
tdnf list installed | cut -f1 -d"."
proj_urls:
in container:
tdnf check-update > /dev/null
pkgs=`tdnf list installed | cut -f1 -d"."`
for p in $pkgs; do tdnf info $p | head -9 | tail -1 | cut -f2-3 -d":" | xargs; done
versions:
in container:
tdnf check-update > /dev/null
list=`tdnf list installed`
c=0; for l in $list; do if [ $c == 1 ]; then echo $l; fi; c=$(((c+1)%3)); done;
info: Layer created by commands: /bin/sh -c tdnf remove -y toybox && tdnf install -y tar findutils attr util-linux python3 python3-pip python3-setuptools git && pip3 install --upgrade pip && pip3 install tern
info: Retrieved by invoking listing in command_lib/base.yml
licenses:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -7 | tail -1 | cut -f2 -d' '; done
names:
in container:
pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='
proj_urls:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -7 | tail -1 | cut -f2 -d' '; done
versions:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -2 | tail -1 | cut -f2 -d' '; done
info: Layer created by commands: /bin/sh -c tdnf remove -y toybox && tdnf install -y tar findutils attr util-linux python3 python3-pip python3-setuptools git && pip3 install --upgrade pip && pip3 install tern
info: Retrieved by invoking listing in command_lib/base.yml
licenses:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -7 | tail -1 | cut -f2 -d' '; done
names:
in container:
pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='
proj_urls:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -7 | tail -1 | cut -f2 -d' '; done
versions:
in container:
pkgs=`pip3 list --format=freeze 2> /dev/null | cut -f1 -d'='`
for p in $pkgs; do pip3 show $p 2> /dev/null | head -2 | tail -1 | cut -f2 -d' '; done
Invoking commands from command_lib/base.yml:
warning: No listing method for 'copyrights'. Additional analysis may be required.
No listing method for 'srcs'. Additional analysis may be required.
warning: No listing method for 'copyrights'. Additional analysis may be required.
No listing method for 'srcs'. Additional analysis may be required.
warning: No listing method for 'copyrights'. Additional analysis may be required.
No listing method for 'srcs'. Additional analysis may be required.
File licenses found in Layer: None
Packages found in Layer: Linux-PAM-1.3.0-1.ph3, apr-1.6.5-2.ph3, <etc, etc>
Expected behavior
Remove duplicate warnings/notices.