]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
po/update-potfiles: fallback to `find` when git doesn't work
authorJan Chren (rindeal) <dev.rindeal@gmail.com>
Fri, 4 Oct 2019 14:40:49 +0000 (16:40 +0200)
committerJan Chren (rindeal) <dev.rindeal@gmail.com>
Fri, 4 Oct 2019 14:40:49 +0000 (16:40 +0200)
It allows to run po/update-potfiles not only in tarballs
and git repositories, but in git snapshots as well.

po/update-potfiles

index 884e4d9fc75dffa42a67dd355de0cee7d7f85a84..1cbfdc4705294134c425d95d84c0bb40e560647c 100755 (executable)
@@ -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=$(