From 31588404af7aef4878991df9d4bfd6fdf2c78b72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Thu, 21 Feb 2019 18:35:19 -0300 Subject: [PATCH] add an own version of `autopoint' which works well here --- archive/gettext-tiny/autopoint | 82 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 archive/gettext-tiny/autopoint diff --git a/archive/gettext-tiny/autopoint b/archive/gettext-tiny/autopoint new file mode 100644 index 00000000..971020fe --- /dev/null +++ b/archive/gettext-tiny/autopoint @@ -0,0 +1,82 @@ +#! /bin/sh - +# +# autopoint: Copies standard gettext infrastructure (lightweight version). +# +# Alternative version for Dragora GNU/Linux-Libre. +# Under the terms of the Apache License version 2. + +PROGRAM="${0##*/}" + +# A parser function to extract the value of 'AC_CONFIG_AUX_DIR' + +aparse() +{ + inside='.*' + search='AC_CONFIG_AUX_DIR' + pre='([' stu='])' + + export inside search pre stu + + awk '#!/usr/bin/awk -f +BEGIN { + npre = length( pre = ENVIRON[ "search" ] ENVIRON[ "pre" ] ) + nstu = length( stu = ENVIRON[ "stu" ] ) +} +function g( s ) { gsub(/./, "[&]", s); return s } + +match( $0, g( pre ) ENVIRON["inside"] g( stu ) ) { + print substr( $0, RSTART + npre, RLENGTH -npre -nstu ) +}' "$@" + + unset inside search pre +} + +# Default directory for gettext infrastructure +DATADIR="${DATADIR:-/usr/share/gettext-tiny}" + +# Sanity checks + +if test ! -d "$DATADIR" +then + echo "${PROGRAM}: ${DATADIR}: Internal directory does not exist." 1>&2 + exit 1 +fi +if test "$PWD" = / || test "$PWD" = "$DATADIR" +then + echo "${PROGRAM}: Current working directory is $PWD (forbidden)" 1>&2 + exit 1 +fi +if test ! -e configure.ac +then + echo "${PROGRAM}: cannot access configure.ac: No such file or directory" 1>&2 + exit 1 +fi + +# Remove write permission for group and other +umask 022 + +mkdir -p -- m4 intl po + +for file in "${DATADIR}/m4"/*.m4 +do + cp -f -- "$file" m4/ +done +unset file + +dirprefix="$(aparse configure.ac)" + +mkdir -p -- "$dirprefix" +touch "${dirprefix}/config.rpath" ABOUT-NLS + +unset dirprefix + +for file in intl/Makefile.in po/Makefile.in.in +do + cp -f "${DATADIR}/data/autopoint_Makefile.in" -- "$file" + chmod 644 -- "$file" +done +unset file + +cp -f "${DATADIR}/data/Makevars.template" po/Makevars.template +chmod 644 po/Makevars.template + -- 2.11.4.GIT