bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [sr #109125] Detecting missing files in POTFILES


From: Bruno Haible
Subject: [bug-gettext] [sr #109125] Detecting missing files in POTFILES
Date: Sat, 27 Oct 2018 12:45:18 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0

Follow-up Comment #2, sr #109125 (project gettext):

Note: The Autoconf project has a Makefile.maint that contains this target:


# Verify that all source files using _() are listed in po/POTFILES.in.
# FIXME: don't hard-code file names below; use a more general mechanism.
po-check:
        if test -f po/POTFILES.in; then                                 \
          grep -E -v '^(#|$$)' po/POTFILES.in                           \
            | grep -v '^src/false\.c$$' | sort > address@hidden;                
        \
          files=;                                                       \
          for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do             \
            case $$file in                                              \
            djgpp/* | man/*) continue;;                                 \
            esac;                                                       \
            case $$file in                                              \
            *.[ch])                                                     \
              base=`expr " $$file" : ' \(.*\)\..'`;                     \
              { test -f $$base.l || test -f $$base.y; } && continue;;   \
            esac;                                                       \
            files="$$files $$file";                                     \
          done;                                                         \
          grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > address@hidden;  
\
          diff -u address@hidden address@hidden || exit 1;                      
                \
          rm -f address@hidden address@hidden;                                  
        \
        fi


And the gnulib/top/maint.mk contains the target sc_po_check, that does similar
things:

# Verify that all source files using _() (more specifically, files that
# match $(_gl_translatable_string_re)) are listed in po/POTFILES.in.
po_file ?= $(srcdir)/po/POTFILES.in
generated_files ?= $(srcdir)/lib/*.[ch]
_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
            | grep -v '^src/false\.c$$' | sort > address@hidden;                
        \
          files=$$(perl $(perl_translatable_files_list_)                \
            $$($(VC_LIST_EXCEPT)) $(generated_files));                  \
          grep -E -l '$(_gl_translatable_string_re)' $$files            \
            | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > address@hidden; 
\
          diff -u -L $(po_file) -L $(po_file) address@hidden address@hidden     
                \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
          rm -f address@hidden address@hidden;                                  
        \
        fi



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?109125>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]