File: update_linguas.sh

package info (click to toggle)
iso-codes 4.20.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,044 kB
  • sloc: python: 626; sed: 137; sh: 65; makefile: 2
file content (30 lines) | stat: -rwxr-xr-x 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

# SPDX-FileCopyrightText: 2025 Dr. Tobias Quathamer <toddy@debian.org>
#
# SPDX-License-Identifier: LGPL-2.1-or-later

set -e

update_linguas() {
    domain=$1

    # Add copyright and license header
    {
        # REUSE-IgnoreStart
        echo "# SPDX-FileCopyrightText: 2025 Dr. Tobias Quathamer <toddy@debian.org>"
        echo "#"
        echo "# SPDX-License-Identifier: LGPL-2.1-or-later"
        # REUSE-IgnoreEnd

        for filename in $(find "$domain" -iname "*po" | LC_ALL=C sort); do
            basename "$filename" .po
        done
    } > "$domain"/LINGUAS
}

DOMAINS=$(find . -maxdepth 1 -iname "iso_*" -type d | LC_ALL=C sort | xargs -n1 basename)
for domain in $DOMAINS; do
    echo "Processing $domain"
    update_linguas "$domain"
done