чување c7ff94cfe5226475989e5c1b3267e3257116eb24
родитељ dc547583152405c9bcd684c98ce411c0b0784a84
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Tue, 21 Feb 2023 21:39:36 +0100
README, table.1.in: Update copyright years; version.do: Avoid su if EUID = owner of source dir
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 3, додавања: 13(+), брисања: 4(-)
diff --git a/README b/README
@@ -123,7 +123,7 @@ $ su
-------
table - Command line utility to format and display CSV.
- Copyright (C) 2020, 2021 Страхиња Радић
+ Copyright (C) 2020, 2021, 2022, 2023 Страхиња Радић
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/table.1.in b/table.1.in
@@ -40,7 +40,7 @@ table \- Command line utility to format and display CSV.
.YS
.
.SH COPYRIGHT
-table Copyright \(co 2020, 2021, 2022 Strahinya Radich.
+table Copyright \(co 2020, 2021, 2022, 2023 Strahinya Radich.
.br
This program is licensed under GNU GPL v3 or later. See the file
.I LICENSE
diff --git a/version.do b/version.do
@@ -1,5 +1,14 @@
FALLBACKVER=${FALLBACKVER:-unknown}
-{ command -v git >/dev/null 2>&1 && git describe >/dev/null 2>&1; } && \
- git describe 2>/dev/null | sed 's/^v//' >$3 || echo $FALLBACKVER >$3
+user=$(stat -c %U .)
+e_user=$(id -un)
+if command -v git >/dev/null 2>&1; then
+ if [ "$e_user" = "$user" ]; then
+ git describe 2>/dev/null | sed 's/^v//' >$3
+ else
+ su "${user}" -c 'git describe' 2>/dev/null | sed 's/^v//' >$3
+ fi
+else
+ echo $FALLBACKVER >$3
+fi
redo-always
redo-stamp <$3