/
githubmirror
/
strace
Обзор
Документация
Войти
/
githubmirror
/
strace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
maint/update-xlat.sh
58 строк
817 B
Dmitry V. Levin
xlat: convert "Generated by maint/enum2xlat.sh" comments into directives
28 окт 2025, 11:00
28 окт 2025, 11:00
58bc1bb
Код
Авторство
О чём код?
#!/bin/sh -efu # Copyright (c) 2025 Dmitry V. Levin <ldv@strace.io> # All rights reserved. # # SPDX-License-Identifier: LGPL-2.1-or-later print_help() { cat <<__EOF__ $0 FILE... $0 [-h|--help] Update generated xlat files. Options: -h, --help Print this message and exit. __EOF__ exit "$@" } print_usage() { print_help 1 >&2 } while :; do case "${1:-}" in -h|--help) print_help 0 ;; -*) print_usage ;; *) break ;; esac shift done [ $# -gt 0 ] || print_usage by='(maint\/[[:alpha:]][[:alnum:]_]+\.sh)' from='"enum ([[:alpha:]][[:alnum:]_]+)"' in='(bundled\/[[:alpha:]][[:alnum:]_/-]+\.h)' expr='1 s/^#Generated by '"$by from $from in $in"'; do not edit\.$/\1 --stdout \3 \2/p' for file; do cmd="$(sed -r -n "$expr" "$file")" [ -n "$cmd" ] || continue eval $cmd > "$file" done