From 5b487da47a88798e7a93d5aa06169f143fd0b2d8 Mon Sep 17 00:00:00 2001 From: yemou Date: Tue, 28 Jul 2020 03:06:56 +0000 Subject: [PATCH] Add support for gentoo and fix shellcheck warning --- posixfetch | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/posixfetch b/posixfetch index a98e449..af945b2 100755 --- a/posixfetch +++ b/posixfetch @@ -2,9 +2,6 @@ # # this is my attempt at trying to make a fetch using only posix shell # and as little if none external utilities as I can. -# -# shellcheck disable=SC2034 -# ## Terminal @@ -34,14 +31,21 @@ done # horribly inefficient, I know. [ -d /var/lib/pacman/local ] && { pkgs=0 - for i in /var/lib/pacman/local/*; do + for _ in /var/lib/pacman/local/*; do pkgs=$(( pkgs + 1 )) done } [ -d /var/db/xbps ] && { pkgs=0 - for i in /var/db/xbps/*; do + for _ in /var/db/xbps/*; do + pkgs=$(( pkgs + 1 )) + done +} + +[ -d /var/db/pkg ] && { + pkgs=0 + for _ in /var/db/pkg/*/*; do pkgs=$(( pkgs + 1 )) done }