Skip to content
This repository has been archived by the owner on Aug 9, 2019. It is now read-only.

Added Clamscan option before installing new package #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/lib/pkgbuild.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,15 @@ install_package() {
while true; do
echo
msg "$(_gettext "Continue installing %s ?" "$pkgbase") $(yes_no 1)"
prompt $(gettext '[v]iew package contents [c]heck package with namcap')
local answer=$(builduserinput "YNVC" "Y")
prompt $(gettext '[s]can with clamscan [v]iew package contents [c]heck package with namcap') # JACK CUSTOM EDIT HERE
local answer=$(builduserinput "YNVCS" "Y") # JACK CUSTOM EDIT HERE
echo
case "$answer" in
V) local i=0
for _file in "$YPKGDEST"/!(*.sig); do
(( i++ )) && { prompt2 $(gettext 'Press any key to continue'); read -n 1; }
echo "$YPKGDEST"/!(*.sig)
msg $(gettext "$YPKGDEST"/!(*.sig))
for _file in "$YPKGDEST"/!(*.sig)
do (( i++ )) && { prompt2 $(gettext 'Press any key to continue'); read -n 1; }
$PACMAN -Qlp "$_file"
done
;;
Expand All @@ -340,6 +342,14 @@ install_package() {
fi
echo
;;
# JACK CUSTOM EDITS START
S)
if command -v "clamscan" &> /dev/null 2>&1; then
clamscan -r -a -z --detect-broken --no-summary --stdout $($PACMAN -Qlp $(msg $(gettext $YPKGDEST/!(*.sig))))
else warning $(gettext 'clamscan is missing from path, is clamav installed?')
fi
;;
# JACK CUSTOM EDITS END
Y) break;;
*) failed=1; break;;
esac
Expand Down