]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
linguas: Ensure that linguas.sh runs from the directory that it resides
authorGlenn Washburn <development@efficientek.com>
Mon, 17 Nov 2025 04:23:41 +0000 (22:23 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 18 Nov 2025 13:34:43 +0000 (14:34 +0100)
The script assumes that it is run from the root of the source tree,
which is where it is located. So this should be enforced to prevent
accidental misuses.

realpath is used instead of readlink as that is recommended in Debian's
readlink manpage since at least Debian 11. Also, use the shell variable's
parameter expansion for removing a suffix pattern to get the directory
in which the script resides. This is preferable to using the dirname binary
as it avoids creating a new process.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
linguas.sh

index b95ad4f7d9c27571671c8c567fd0a2592f3cc62a..45cdf2ac14acf8e0bfa5129bf028a0cf6fd4b913 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+SDIR=$(realpath -e "$0")
+SDIR=${SDIR%/*}
+
+cd "$SDIR"
+
 rsync -Lrtvz translationproject.org::tp/latest/grub/ po
 
 autogenerated="en@quot en@hebrew de@hebrew en@cyrillic en@greek en@arabic en@piglatin de_CH"