Skip to content

Commit

Permalink
collect lore for lib/ and libexec/
Browse files Browse the repository at this point in the history
Not recursively for now (based on the assumption that lib and libexec
subdirectories will be more-specific than we want...)
  • Loading branch information
abathur committed Mar 26, 2022
1 parent beb7f42 commit e2dca63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ let
# since this form will make it easier to pilot other
# uses of binlore.
callback = lore: drv: overrides: ''
if [[ -d "${drv}/bin" ]]; then
if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then
echo generating binlore for $drv by running:
echo "${yara}/bin/yara ${lore.rules} ${drv}/bin | ${yallback}/bin/yallback ${lore.yallback}"
echo "${yara}/bin/yara --scan-list ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback}"
else
echo "failed to generate binlore for $drv (${drv}/bin doesn't exist)"
fi
Expand All @@ -75,8 +75,8 @@ let
fi
((i--)) || true # don't break build
done # || true # don't break build
if [[ -d "${drv}/bin" ]]; then
${yara}/bin/yara ${lore.rules} ${drv}/bin | ${yallback}/bin/yallback ${lore.yallback} "$filter"
if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then
${yara}/bin/yara --scan-list ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback} "$filter"
fi
'';
};
Expand Down

0 comments on commit e2dca63

Please sign in to comment.