1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-06-19 03:30:32 -04:00
ports/polish/napi/files/patch-libs_libnapi__wrappers.sh
Dominik Lisiak 670f711350 polish/napi: Add new port
"napi.sh" is a napiprojekt.pl client written in Bash. The purpose of
the project was to create simple tool for systems with very limited
resources (NAS QNAP drives, Synology, OpenWRT routers, Popcorn
streamers, etc). It was inspired by "pynapi.py" script.

"napi.sh" is distributed together with automatic subtitle format
converter "subotage.sh" created specially for "napi.sh". "subotage.sh"
is written in Bash and uses awk for text processing.

PR:		245996
2021-11-01 01:08:14 +09:00

24 lines
638 B
Bash

--- libs/libnapi_wrappers.sh.orig 2020-04-24 07:38:48 UTC
+++ libs/libnapi_wrappers.sh
@@ -129,13 +129,20 @@ wrappers_isSystemDarwin() {
}
#
+# @brief returns true if system is FreeBSD
+#
+wrappers_isSystemFreeBSD() {
+ [ "$(wrappers_getSystem_SO)" = "freebsd" ]
+}
+
+#
# @brief determines number of available cpu's in the system
#
# @param system type (linux|darwin)
#
wrappers_getCores_SO() {
local os="${1:-linux}"
- if wrappers_isSystemDarwin; then
+ if wrappers_isSystemDarwin || wrappers_isSystemFreeBSD; then
sysctl hw.ncpu | cut -d ' ' -f 2
else
grep -i processor /proc/cpuinfo | wc -l