From: Jan Chren (rindeal) Date: Fri, 4 Oct 2019 14:40:49 +0000 (+0200) Subject: po/update-potfiles: fallback to `find` when git doesn't work X-Git-Tag: v2.35-rc1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7f9588745f34f5973eecf33d1c7e8aec04666d2;p=thirdparty%2Futil-linux.git po/update-potfiles: fallback to `find` when git doesn't work It allows to run po/update-potfiles not only in tarballs and git repositories, but in git snapshots as well. --- diff --git a/po/update-potfiles b/po/update-potfiles index 884e4d9fc7..1cbfdc4705 100755 --- a/po/update-potfiles +++ b/po/update-potfiles @@ -15,11 +15,13 @@ fi # find all git-tracked files source_files=$(git ls-files . 2>/dev/null) if [ $? -ne 0 ] || [ -z "$source_files" ]; then - echo "$0: warning: update-potfiles requires git" >&2 # we still go through the rest of this script to provide at least an empty # list or remove non-existing (deleted) files source_files=$(cat po/POTFILES.in 2>/dev/null) fi +if [ $? -ne 0 ] || [ -z "$source_files" ]; then + source_files=$(find . -type f -printf "%P\\n" 2>/dev/null) +fi # apply include/exclude patterns source_files=$(