Skip to content

Commit

Permalink
Fix duplicate package reporting for alpine images
Browse files Browse the repository at this point in the history
The apk package version collection utility in base.yml was not correctly
parsing version strings for the "libstdc++" package name (and possibly
others with non-alpha numeric characters). This was causing Tern to
report an empty version string for the libstdc++ package which led to
missing version strings and incorrect layer packages in the output
report. This commit slightly tweaks the package version collection
script to use sed instead of awk in order to properly collect and
report the package version information.

Resolves #881

Signed-off-by: Rose Judge <rjudge@vmware.com>
  • Loading branch information
rnjudge authored and Nisha K committed Feb 18, 2021
1 parent 52b4e29 commit 1c8d031
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tern/analyze/default/command_lib/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ apk:
container:
# use double quotes when using awk
- "pkgs=`apk info 2>/dev/null`"
- "for p in $pkgs; do lic=`apk info $p 2>/dev/null | head -1 | awk '{print $1}'`; echo $lic | awk -F \"${p}-\" '{print $2}'; done"
- "for p in $pkgs; do lic=`apk info $p 2>/dev/null | head -1 | awk '{print $1}'`; echo $lic | sed -e \"s/^$p-//\"; done"
delimiter: "\n"
licenses:
invoke:
Expand Down

0 comments on commit 1c8d031

Please sign in to comment.