poe

Уређивач .po фајлова
git clone https://git.sr.ht/~strahinja/poe
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување c7a458f3a45badfd8094e5cd69e10d556a6ab846
родитељ 51c86416f4c706c47ace37d7102d0aa29bd31971
Аутор: Страхиња Радић <sr@strahinja.org>
Датум:   Sat, 21 Mar 2026 16:19:14 +0000

lib/make{date,version}: Fix build scripts for HaikuOS

Diffstat:
Mlib/makedate | 17+++++++++--------
Mlib/makeversion | 17+++++++++--------
измењених датотека: 2, додавања: 18(+), брисања: 16(-)

diff --git a/lib/makedate b/lib/makedate @@ -15,19 +15,18 @@ exists() command -v $* >/dev/null 2>&1 } -getent() +_getent() { - geresult='' if exists getent; then - geresult=$(command getent "$@" 2>/dev/null) + command getent "$@" 2>/dev/null return fi case "$1" in passwd|group) if [ -z "$2" ]; then - geresult=$(cat /etc/"$1") + cat /etc/"$1" else - geresult=$(awk -F: -vu="$2" '{ if ($3 == u) print }' /etc/"$1") + awk -F: -vu="$2" '{ if ($3 == u) print }' /etc/"$1" fi ;; *) ;; @@ -58,9 +57,11 @@ if [ -d .got ] && exists got; then exit }' >date.new elif [ -d .git ] && exists git; then - getent passwd "$(unalias ls >/dev/null 2>&1 || true; \ - command ls -nd . | awk '{print $3}')" - user=$(printf "%s\n" "$geresult" | awk -F: '{print $1}') + + user=$(printf "%s\n" "$(_getent passwd \ + "$(unalias ls >/dev/null 2>&1 || true; \ + command ls -nd . | awk '{print $3}')")" | + awk -F: '{print $1}') if [ -z "$user" ]; then printf "$0: error: Cannot determine owner of %s" "$(pwd)" >&2 exit 1 diff --git a/lib/makeversion b/lib/makeversion @@ -15,19 +15,18 @@ exists() command -v $* >/dev/null 2>&1 } -getent() +_getent() { - geresult='' if exists getent; then - geresult=$(command getent "$@" 2>/dev/null) + command getent "$@" 2>/dev/null return fi case "$1" in passwd|group) if [ -z "$2" ]; then - geresult=$(cat /etc/"$1") + cat /etc/"$1" else - geresult=$(awk -F: -vu="$2" '{ if ($3 == u) print }' /etc/"$1") + awk -F: -vu="$2" '{ if ($3 == u) print }' /etc/"$1" fi ;; *) ;; @@ -65,9 +64,11 @@ if [ -d .got ] && exists got; then printf "\n" }' >version.new elif [ -d .git ] && exists git; then - getent passwd "$(unalias ls >/dev/null 2>&1 || true; \ - command ls -nd . | awk '{print $3}')" - user=$(printf "%s\n" "$geresult" | awk -F: '{print $1}') + + user=$(printf "%s\n" "$(_getent passwd \ + "$(unalias ls >/dev/null 2>&1 || true; \ + command ls -nd . | awk '{print $3}')")" | + awk -F: '{print $1}') if [ -z "$user" ]; then printf "$0: error: Cannot determine owner of %s" "$(pwd)" >&2 exit 1